Toolvito

Works on this device

Character Encoding Converter

See the bytes of any text in UTF-8, UTF-16 and other encodings, or turn bytes back into text. The page is strict: it names the place of every byte or character that does not fit. Your text is converted in your browser and is not sent to a server.

Your text or bytes

Every character counts, also spaces and line breaks.

UTF-8 is the usual choice for files and the web.

More options

Your text is converted in this browser. It is not sent to a server.

The result will show here

Type or paste something, or choose Try an example.

How to use the encoding converter

  1. Choose what to do in the menu: text to bytes, bytes to text, change bytes from one encoding to another, repair text, make text plain ASCII, or see the ASCII table.
  2. Type or paste your text, or the bytes in hexadecimal such as C3 A9. The result shows as you type.
  3. Choose the encoding. UTF-8 is the usual one for files and the web.
  4. Choose Copy output or Download output to keep the result. Download CSV also saves the table.

What a character encoding is

A computer stores text as bytes. A character encoding is the rule that says which bytes stand for which character. If text is written with one rule and read with another, wrong signs show.

  • UTF-8 covers every character of Unicode. The 128 ASCII characters take 1 byte each and other characters take 2, 3 or 4 bytes.
  • UTF-16 uses 2 bytes for most characters and 4 bytes (a surrogate pair) for the others, such as emoji. The two bytes can come in either order: little endian or big endian.
  • UTF-32 uses 4 bytes for every character.
  • ISO-8859-1 (Latin-1) uses 1 byte for each of 256 characters, for Western European languages. Byte E9 is é.
  • Windows-1252 is like ISO-8859-1, but the bytes 80 to 9F hold printed signs such as € and curly quotes.
  • ASCII has 128 characters: the letters of English, digits and common signs.
  • A byte order mark is a short mark at the start of a file that tells which encoding and byte order it uses. In UTF-8 it is the bytes EF BB BF.

Worked example

The text Zoë’s café – 5 € has 16 characters. In UTF-8 it is 24 bytes: ë and é take 2 bytes each, and the curly apostrophe, the dash and the euro sign take 3 bytes each. In UTF-16 it is 32 bytes and in UTF-32 it is 64 bytes. Windows-1252 can hold it in 16 bytes. ISO-8859-1 and ASCII cannot hold it.

The UTF-8 bytes C3 A9 are the letter é. Read as Windows-1252, the same two bytes show as é. The repair mode turns Café – naïve back into Café – naïve.

The ISO-8859-1 bytes 63 61 66 E9 are café. Changed to UTF-8 they are 63 61 66 C3 A9.

Strict checks

  • When you turn bytes into text, the page stops at the first byte that is not valid in the chosen encoding and tells you its number. Under More options you can ask for such bytes to show as � instead.
  • When you turn text into bytes, the page stops at the first character that the encoding cannot hold and names it.
  • UTF-8 is checked by the rules of the Unicode Standard. Forms that are too long, surrogates and values above 10FFFF are not valid.
  • Windows-1252 has five byte values with no character: 81, 8D, 8F, 90 and 9D. They are reported as errors. The repair mode accepts them, because browsers pass them through as control characters.

Limits you should know

  • The page works on typed text and on bytes typed in hexadecimal. It can open a text file that is in UTF-8, but it does not open files in other encodings and does not save a file in another encoding.
  • Other encodings, such as Shift JIS, GBK, Big5 and KOI8-R, are not covered.
  • The repair mode handles one common case: UTF-8 text that was read as Windows-1252 or ISO-8859-1. It cannot bring back characters that were lost and already show as ? or �.
  • Plain ASCII drops marks, which is right for English use. In some languages a letter without its mark is another letter. Characters with no plain form are replaced, removed or written as escapes, as you choose, and the table lists every change.
  • Text can have up to 200,000 characters, and a list of bytes up to 600,000 characters.
  • Pictures and banners made of characters (ASCII art) are not made here.

Related tools