Text ↔ hex, binary, decimal
Turn text into its bytes (UTF-8, UTF-16, Latin-1, Windows-1252, ASCII) shown as hexadecimal, binary, decimal, octal or Base64, and go the other way round. Decoding errors are reported with their position, with no silent replacement.
Your data stays on your computer. Files are processed in your browser and are never uploaded.
The file stays in your browser: it is not uploaded anywhere. At most the first 1 MB is read.
Result
Type some text, paste bytes or choose a file to see the result.
How to use it
- Pick the direction: Text → bytes to see the bytes of a text, Bytes → text to decode bytes you already have.
- Pick the encoding (UTF-8 is the one used almost everywhere) and the byte format: hexadecimal, binary, decimal, octal or Base64.
- Adjust separator, grouping, case and bytes per line. When reading bytes it accepts spaces, commas, dashes and the prefixes 0x, \x and % even mixed together.
- Check the character table below, then copy the result or save it as a .bin file (the real bytes) or .txt.
Frequently asked questions
Why is "è" two bytes in UTF-8 and one in Latin-1?
UTF-8 uses 1 to 4 bytes per character: ASCII uses one, accented letters two (è = C3 A8), emoji four. Latin-1 and Windows-1252 always use one byte, but only know 256 characters (è = E8).
What does "invalid bytes in UTF-8" mean?
That the sequence is not correct UTF-8: for example a lone byte such as FF, a truncated sequence or a byte that was really Latin-1. The tool reports the position of the first error instead of silently replacing it; if you want the text anyway, turn on the replacement with �.
What is the difference between Latin-1 and Windows-1252?
They match except for bytes 0x80-0x9F: in Latin-1 they are control characters, in Windows-1252 they are letters and symbols such as €, curly quotes and long dashes. Web texts labelled "Latin-1" are almost always Windows-1252.
What happens to characters the encoding does not have?
In ASCII, Latin-1 and Windows-1252 a character that does not exist (an emoji, say) becomes "?" and the tool tells you how many there are. UTF-8 and UTF-16 represent all of Unicode.
What is the BOM?
A short sequence at the start of a file (EF BB BF in UTF-8, FF FE or FE FF in UTF-16) that tells the encoding. When reading bytes it is removed from the text and reported; when writing you can add it with the option.
Privacy
Everything happens in your browser: text and files are not sent or saved. The share link never includes the file and includes the text only if it is short, in the part after the # of the address.