Text Encoding Converter

Convert a text file, pasted text or raw bytes from one character encoding to another: Windows-1252, ISO-8859, KOI8-R, Shift_JIS, EUC-JP, GBK, Big5, EUC-KR and more, to and from UTF-8, UTF-16 or UTF-32. It detects the source, points to every invalid byte and every character the target cannot store, and runs in your browser.

Converter Text & Encoding Updated Oct 15, 2026
How to Use
  1. Drop a text file on the box (or choose one), type or paste text, or paste raw bytes as hex or Base64. A preset loads a ready-made sample file.
  2. Check the From encoding. Auto-detect reads the byte-order mark, checks whether the bytes are valid UTF-8 and looks for UTF-16 zero bytes; for older code pages it ranks the likely readings, and you can override the guess.
  3. Pick the To encoding, whether the output gets a byte-order mark, and what to do with characters the target cannot store: stop and list them, write ?, write an HTML entity such as €, or use the closest plain character.
  4. Read the result: the diagram shows one character as bytes in both encodings, the readouts count characters and bytes, and any invalid bytes or missing characters are listed with their positions. Show Work explains each step.
  5. Download the converted file (same name with an encoding suffix, or the original name), or copy the text, hex or Base64 of the output.
Input
source encoding
target encoding
Line endings (CRLF, LF, CR) are kept exactly as they are; use the Line Ending Converter to change them.
Presets (sample files)
Conversion
Source
—
Characters
—
Bytes in → out
—
Problems
—

Worked Example

café from Windows-1252 to UTF-8. In Windows-1252 every character is one byte, so “café” is 63 61 66 E9: 4 bytes. The first three are ASCII and stay the same in UTF-8. The fourth, E9, is é, code point U+00E9 (233), which is above 127, so UTF-8 needs two bytes: 233 in binary is 11101001, split as 00011 and 101001 into 11000011 10101001 = C3 A9. The file grows from 4 bytes to 5 (63 61 66 C3 A9), or 8 with the UTF-8 byte-order mark EF BB BF that Excel looks for.

日本 from Shift_JIS to UTF-8. Shift_JIS stores each of these kanji in two bytes: 日 is 93 FA and 本 is 96 7B, 4 bytes in all. Their code points are U+65E5 and U+672C, both between U+0800 and U+FFFF, so UTF-8 uses three bytes each: E6 97 A5 and E6 9C AC, 6 bytes. In UTF-16 LE they are 4 bytes again: E5 65 2C 67.

The common mistake: assuming ISO-8859-1 and Windows-1252 are the same. “5 €” in Windows-1252 is 35 20 80. A program that reads it as true ISO-8859-1 turns 80 into the invisible control character U+0080, and the euro sign disappears. Going the other way, “5 €” cannot be written in ISO-8859-1 at all, because Latin-1 has no euro sign; this converter lists it as missing instead of writing a wrong byte. Browsers hide the difference, because they read anything labelled “iso-8859-1” as Windows-1252.

Show Work

Load a file, type text or pick a preset to see each step of the conversion.

Bytes per Character

UTF-8
1 byte: U+0000–007F
2 bytes: U+0080–07FF
3 bytes: U+0800–FFFF
4 bytes: U+10000–10FFFF
RFC 3629. é (U+00E9) = C3 A9; € (U+20AC) = E2 82 AC; 😀 (U+1F600) = F0 9F 98 80
UTF-16
2 bytes: U+0000–FFFF
4 bytes: U+10000–10FFFF
Above FFFF a surrogate pair: high = D800 + ((cp − 10000) ÷ 400), low = DC00 + ((cp − 10000) mod 400), in hex. 😀 = D83D DE00
UTF-32
4 bytes for every character
The code point itself as a 32-bit number. Simple, but 4 times the size of ASCII text
Single-byte code pages
1 byte, 256 values
Windows-125x, ISO-8859-x, KOI8, Mac Roman, CP437. 00–7F is ASCII; 80–FF differ per code page
Shift_JIS, GBK, Big5, EUC-KR
1 byte for ASCII, 2 bytes otherwise
Shift_JIS half-width katakana (ア) is 1 byte; EUC-JP writes it in 2 (8E B1)
GB18030
1, 2 or 4 bytes
Same 2-byte codes as GBK, plus 4-byte codes that reach every Unicode character
Byte-order marks
UTF-8: EF BB BF
UTF-16 LE: FF FE · BE: FE FF
UTF-32 LE: FF FE 00 00 · BE: 00 00 FE FF
U+FEFF encoded in the target. Legacy code pages have none
Size change
café: 4 B (1252) → 5 B (UTF-8) → 8 B (UTF-16)
日本: 4 B (Shift_JIS) → 6 B (UTF-8) → 4 B (UTF-16)
Привет: 6 B (KOI8-R) → 12 B (UTF-8)
Plain English text is the same size in every ASCII-based encoding and doubles in UTF-16

From ASCII to UTF-8

The first edition of ASCII was published in 1963. It used 7 bits, so it had room for 128 codes: English letters, digits, punctuation and control characters. Computers stored text in 8-bit bytes, which left the values 128 to 255 free, and every region filled them differently. ISO 8859-1 (Latin-1, 1987, based on ECMA-94 from 1985) covered Western European languages, with 8859-2, -5, -7 and others for Central European, Cyrillic, Greek and more. Microsoft’s Windows code pages followed the same layout but put printable characters in 80 to 9F, which the ISO standards reserve for C1 control codes; that is why Windows-1252 has €, “ ” and — and ISO-8859-1 does not. Russia had KOI8-R, Windows-1251 and DOS code page 866 at the same time, all for the same alphabet.

256 values were never enough for Chinese, Japanese or Korean, so East Asian encodings use two bytes per character. Shift_JIS, created by ASCII Corporation with Microsoft, became the Japanese PC standard; Unix systems used EUC-JP and e-mail used ISO-2022-JP. Mainland China standardised GB 2312 in 1980 (later extended as GBK and GB18030), Taiwan’s Big5 was defined in 1984, and Korea used EUC-KR. A file did not say which encoding it used, so reading it with the wrong one produced mojibake.

Unicode 1.0 was published in October 1991 to give every character one number. UTF-8, which encodes those numbers in 1 to 4 bytes and leaves ASCII unchanged, was designed by Ken Thompson and Rob Pike in September 1992 and standardised as RFC 3629 in November 2003, which limited it to U+10FFFF. Browsers now follow the WHATWG Encoding Standard, which defines exactly how each legacy encoding is read and written; one of its rules is that the labels “iso-8859-1”, “latin1” and “us-ascii” are read as Windows-1252, because that is what such pages really contained. According to W3Techs (15 October 2026), UTF-8 is used by 99.1% of websites whose character encoding is known, ISO-8859-1 by 0.8% and Windows-1252 by 0.2%. The older encodings live on in files: spreadsheets, subtitles, databases and mainframe exports.

About This Tool

This converter does what the iconv command does, in the browser. It reads 43 encodings: UTF-8, UTF-16 and UTF-32 in both byte orders, and 38 others from ASCII, Windows-1252 and the ISO-8859 family to KOI8-R, Shift_JIS, EUC-JP, ISO-2022-JP, GBK, GB18030, Big5 and EUC-KR. It writes all of them except ISO-2022-JP. Reading follows the WHATWG Encoding Standard through the browser’s own decoders; writing follows the same standard’s encoder rules, with every table checked by converting each character there and back. Invalid source bytes are reported with their offset, missing characters with their line and column, and nothing is replaced without telling you.

Everything runs on your device: the file is never uploaded, logged or sent to a server. It is for anyone moving text between old and new systems: spreadsheet and database exports, subtitles, e-mail archives, legacy interfaces and source code.

Related tools: Mojibake Repair Lab for text that is already garbled, BOM Adder / Remover, and Unicode Lab to inspect individual characters.

Frequently Asked Questions

Is ISO-8859-1 the same as Windows-1252?

No, but browsers treat them as the same. The two agree on every byte except 80 to 9F: ISO-8859-1 puts invisible C1 control codes there, while Windows-1252 puts € (80), the curly quotes ‘ ’ “ ” (91 to 94), – and — (96, 97) and a few more. The WHATWG Encoding Standard, which every modern browser follows, makes the labels “iso-8859-1”, “latin1”, “ascii” and “us-ascii” all mean Windows-1252, because so many files labelled Latin-1 were really written on Windows. This converter offers both: Windows-1252, and ISO-8859-1 (strict Latin-1) for systems that really mean it, where € cannot be stored.

What happens to characters the target encoding cannot store?

Nothing is changed silently. The converter lists each missing character with its code point, how often it appears and where (line and column), and lets you choose: stop, replace each with ?, write an HTML numeric entity such as € for € (good for web pages and XML), or use the closest plain character (“ becomes ", — becomes -, é becomes e only when é itself is missing). Characters that exist in decomposed form, such as Vietnamese ế in Windows-1258 (ê plus a combining acute accent), are written that way automatically because the text stays the same.

Should I add a byte-order mark (BOM)?

Add one for a UTF-8 CSV that will be opened in Excel by double-clicking, since without it Excel reads the file in the Windows code page and shows é for é. UTF-16 files normally carry one (FF FE for little-endian) so programs can tell the byte order. Leave it out for web pages, JSON, PHP and shell scripts, where the three bytes EF BB BF can break the first line. Legacy code pages such as Windows-1252 or Shift_JIS have no BOM at all.

How reliable is auto-detect?

A byte-order mark is certain. Valid UTF-8 is almost certain, because random bytes from older encodings rarely form valid UTF-8 sequences. UTF-16 shows itself through zero bytes in every other position. Single-byte code pages, however, cannot be told apart from the bytes alone: E9 is é in Windows-1252, й in Windows-1251 and Ę in ISO-8859-2. For those, the converter decodes the bytes every likely way, scores how much each reading looks like real text, and shows its best guess with the next ones as buttons. Check the preview and override it if the text looks wrong.

Is my file uploaded, and how large can it be?

Nothing is uploaded. Decoding uses your browser’s own TextDecoder, the encoding tables are built in the page, and the converted file is created locally. Large files are processed in chunks so the page stays responsive; in our tests a 50 MB file converted in under a second. The practical limit is your browser’s memory.

How do I use the Text Encoding Converter?

Simply type or paste your value and read the result, which refreshes the instant you change something. There is nothing to submit and nothing to wait for.

Is it free? Does it work without internet?

Yes to both. It is free with no sign-up, and once the page has loaded it keeps working even with no internet.

Where does my data go?

Nowhere — every calculation runs on your own device. Nothing you enter is uploaded, logged, or stored.

Common Use Cases

Old CSV exports into Excel or a database

Turn a Windows-1252 export into UTF-8 with a BOM so “José Müller” and “€ 12,50” survive. Each accented letter grows from 1 byte to 2, and € from 1 byte (80) to 3 (E2 82 AC).

Japanese, Chinese and Korean files

Convert Shift_JIS subtitles, GBK or Big5 documents and EUC-KR pages to UTF-8 for modern players and editors: 日本 is 4 bytes in Shift_JIS and 6 in UTF-8.

Feeding a legacy system

Write UTF-8 text as strict ISO-8859-1, ASCII or a DOS code page for an old mainframe, label printer or bank interface, and get a list of the characters (€, “ ”, —) it cannot take before the file is rejected.

UTF-16 for Windows tools

Produce UTF-16 LE with the FF FE byte-order mark for programs that expect Windows “Unicode” text. Plain English text doubles in size: 1,000 ASCII characters become 2,002 bytes.

Cyrillic and Greek archives

Recover KOI8-R, CP866 or Windows-1251 e-mails and text files as UTF-8: Привет is 6 bytes in KOI8-R (F0 D2 C9 D7 C5 D4) and 12 bytes in UTF-8.

Finding corrupt bytes

Check whether a file is valid UTF-8 and see the offset of every invalid byte, such as a lone E9 written by an old Windows program into a UTF-8 file.

Last updated: