Type text to see its exact UTF-8 bytes as hex, decimal, binary, octal, \x escapes or percent encoding, or paste bytes to decode them back to text. The code point table shows how every character is split into 1 to 4 bytes.
Choose a mode: Encode turns text into UTF-8 bytes, Decode turns bytes back into text.
Pick the byte format, for example spaced hex, decimal, binary, \x escapes or percent encoding.
Type or paste your text or bytes. The result updates instantly as you type.
Check the code point table to see each character's U+ code point and how its bits are spread over the bytes.
Copy or download the result, or press Swap to reverse the conversion.
How UTF-8 encodes a character
UTF-8 writes each Unicode code point with 1 to 4 bytes. The first byte says how many bytes follow, and every following byte starts with the bits 10. The code point's bits (x) are filled in from left to right:
Code point range
Bytes
Bit pattern
Example
U+0000 to U+007F
1
0xxxxxxx
A = 41
U+0080 to U+07FF
2
110xxxxx 10xxxxxx
é (U+00E9) = C3 A9
U+0800 to U+FFFF
3
1110xxxx 10xxxxxx 10xxxxxx
€ (U+20AC) = E2 82 AC
U+10000 to U+10FFFF
4
11110xxx 10xxxxxx 10xxxxxx 10xxxxxx
😀 (U+1F600) = F0 9F 98 80
Worked example for €: U+20AC is 0010 0000 1010 1100 in binary. Split into 4 + 6 + 6 bits: 0010, 000010, 101100. Add the markers: 11100010, 10000010, 10101100 = E2 82 AC.
Invalid UTF-8 and what the decoder reports
Unexpected continuation byte (80 to BF with no lead byte): often a sign that text was cut in the middle of a character.
Sequence cut off at the end: a lead byte such as E2 or F0 without enough following bytes, typical of truncated buffers.
Overlong encoding: a character encoded with more bytes than needed, for example C0 AF for "/". These are forbidden because they were used to bypass security filters.
Surrogates and values above U+10FFFF: ED A0 80 to ED BF BF (U+D800 to U+DFFF) and anything above F4 8F BF BF are not valid UTF-8.
Each invalid sequence becomes one replacement character U+FFFD (EF BF BD), following the same rules as browsers (the WHATWG Encoding Standard).
UTF-8 is the dominant text encoding on the web. It stores every Unicode code point as 1 to 4 bytes: ASCII characters (U+0000 to U+007F) use one byte, most Latin, Greek, Cyrillic, Hebrew and Arabic letters use two, most other scripts including Chinese, Japanese and Korean use three, and emoji and other characters above U+FFFF use four.
How do I convert text to UTF-8 hex?
Type or paste the text in Encode mode with the Hex format selected. Each byte appears as two hex digits, for example é becomes C3 A9 and € becomes E2 82 AC. Choose No separator for a compact string such as C3A9, or the \x format for C, Python and shell byte strings.
How do I decode UTF-8 bytes to text?
Switch to Decode and paste the bytes. The tool detects hex (with or without spaces or 0x), decimal, binary, octal, \x escapes and %XX percent encoding automatically. You can also force a format if the input is ambiguous, for example 10 20 30 could be hex or decimal.
Why do I see the replacement character �?
The byte sequence is not valid UTF-8 at that point, for example a continuation byte without a lead byte, a sequence cut off at the end, an overlong encoding or a byte such as C0, C1 or F5 to FF that never appears in UTF-8. The decoder replaces each bad sequence with U+FFFD and lists its byte offset so you can find the problem.
What is the UTF-8 BOM?
The byte order mark EF BB BF is an optional signature at the start of a UTF-8 file. UTF-8 has no byte order, so it is only a hint that the file is UTF-8. Many tools, JSON parsers and shell scripts dislike it, so it is usually best left out. The decoder strips a leading BOM and tells you it was there.
How many bytes does a character take in UTF-8?
It depends on the code point: U+0000 to U+007F take 1 byte, U+0080 to U+07FF take 2, U+0800 to U+FFFF take 3, and U+10000 to U+10FFFF take 4. An emoji such as 👍🏽 can be several code points, so it may take 8 or more bytes even though it looks like one character.
Is my text sent to a server?
No. Encoding and decoding use your browser's built-in TextEncoder and TextDecoder, so nothing you type or paste leaves your device.
Are all the tools on FreeToolCabin tested for quality and accuracy?
Yes! Every tool on our site undergoes automated Q/A testing in real browser environments to ensure high precision, correct output, and zero errors. If you happen to spot a bug or have a suggestion, please contact us at [email protected] and our team will review it right away.