> utf | encoding | converter <
Convert text to UTF-8, UTF-16 and UTF-32 bytes (LE or BE, with or without BOM) and decode hex bytes back to text.
// ALL ENCODINGS SIDE BY SIDE
| ENCODING | BYTES | HEX |
|---|
All Unicode Encodings
UTF-8, UTF-16 LE/BE and UTF-32 LE/BE with optional byte order mark, in both directions.
Side-by-Side Table
See byte counts and hex for every encoding at once to compare size and byte order.
Strict Decoding
Invalid byte sequences are reported instead of silently replaced, so you can spot corrupt data.
// UTF TECHNICAL INFO
How It Works:
Unicode assigns every character a code point. UTF-8 encodes code points as 1-4 bytes with leading-bit patterns, UTF-16 uses one 16-bit unit or a surrogate pair for code points above U+FFFF, and UTF-32 stores the code point directly in 32 bits.
Example:
é (U+00E9) → UTF-8: C3 A9 | UTF-16 LE: E9 00 | UTF-32 BE: 00 00 00 E9
Why Use This Tool:
- >Debug mojibake and wrong-encoding bugs
- >Inspect the exact bytes a string occupies in each encoding
- >Generate test data with or without a BOM
- >Decode hex dumps of UTF-16 or UTF-32 text
>> frequently asked questions
Q: What is the difference between UTF-8, UTF-16 and UTF-32?
A: All three encode the same Unicode code points. UTF-8 uses 1-4 bytes per character and is ASCII-compatible, UTF-16 uses 2 or 4 bytes (surrogate pairs for characters above U+FFFF), and UTF-32 always uses 4 bytes.
Q: What does LE and BE mean?
A: They are byte orders. Little-endian (LE) stores the least significant byte first; big-endian (BE) stores the most significant byte first. For example "A" is 41 00 in UTF-16 LE and 00 41 in UTF-16 BE.
Q: What is a BOM?
A: The Byte Order Mark is the code point U+FEFF placed at the start of a file so readers can detect the byte order. In UTF-8 it appears as EF BB BF and is optional; for UTF-16 and UTF-32 it is FF FE / FE FF and 00 00 FE FF / FF FE 00 00.
Q: How do I convert UTF-8 to UTF-16?
A: Type or paste your text, pick UTF-16 LE or BE and read the hex bytes. The side-by-side table shows every encoding at once so you can compare lengths and byte values.
Q: How do I decode hex bytes to text?
A: Switch to BYTES → TEXT, pick the encoding the bytes use, and paste the hex. The tool reports invalid sequences instead of silently replacing them.
Q: Why are emoji 4 bytes in UTF-8 but also 4 bytes in UTF-16?
A: Characters above U+FFFF need 4 bytes in UTF-8 and a surrogate pair (two 16-bit units, so also 4 bytes) in UTF-16. The emoji 😀 (U+1F600) is F0 9F 98 80 in UTF-8 and 3D D8 00 DE in UTF-16 LE.
Q: Is my text uploaded anywhere?
A: No, all conversion runs locally in your browser.
// OTHER LANGUAGES
References
How we make sure
We check this tool with the automated test suites linked below. Example checks are shown in their original language.
- Verification method
- Check UTF-8 and UTF-16 bytes, including BMP boundaries, supplementary characters and applicable endian/BOM fixtures.
- Comparison reference
- Node.js Buffer, with explicit expected values for other byte orders.
- Verification scope
- These samples and boundaries do not prove correctness for every input.
Test source and cases (select a file to read it)
-
legacy-reliability.test.js
- UTF converter: UTF-8 and UTF-16LE bytes match Node Buffer, with explicit BOM and endian vectors
These checks cover the listed examples and boundaries, not every possible input. Round trips and checks using the same library are not independent verification.