UTF-8 Converter
Type or paste text to see its UTF-8 bytes in hex, decimal, binary, URL (%) or \x form, with a byte breakdown for every character. Switch to Bytes → text to turn UTF-8 back into text, or open a file and save it as UTF-8.
A → 41 · é → C3 A9 · € → E2 82 AC · 😀 → F0 9F 98 80
43 61 66 C3 A9
4 characters → 5 bytes
Bytes for each character
| Character | Code point | UTF-8 bytes | Bytes |
|---|---|---|---|
| C | U+0043 | 43 | 1 |
| a | U+0061 | 61 | 1 |
| f | U+0066 | 66 | 1 |
| é | U+00E9 | C3 A9 | 2 |
Fine-tune
Everything runs in your browser; nothing is uploaded.
How to convert text to UTF-8
UTF-8 is the way almost all text is stored on computers and sent over the web. Every character is saved as one to four bytes, and a UTF-8 converter shows you those bytes.
- Type or paste your text into the box. The bytes appear straight away.
- Pick how the bytes are written: hex (C3 A9) is the most common, decimal (195 169) is what many programming languages print, binary shows the bits, URL % is for links, and \x escapes is for code.
- Open Bytes for each character to see which bytes belong to which letter.
- Copy the result. To go the other way, click Bytes → text; the bytes are carried across and decoded.
How many bytes does a character take?
It depends on the character. Plain English letters, digits and punctuation take one byte each, exactly as in ASCII. Accented letters need two, most other scripts and symbols need three, and emoji need four.
| Bytes | Code points | Examples | Bit pattern |
|---|---|---|---|
| 1 | U+0000 – U+007F | A–Z, a–z, 0–9, space, ! ? @ # | 0xxxxxxx |
| 2 | U+0080 – U+07FF | é ñ ü ß £ ©, Greek, Cyrillic, Hebrew, Arabic | 110xxxxx 10xxxxxx |
| 3 | U+0800 – U+FFFF | € ’ — ™, Chinese, Japanese, Korean, Hindi | 1110xxxx 10xxxxxx 10xxxxxx |
| 4 | U+10000 – U+10FFFF | Emoji such as 😀 and 👍, rare historic scripts | 11110xxx 10xxxxxx ×3 |
The first bits of each byte say what it is: a byte starting with 0 is a whole character, one starting with 110, 1110 or 11110 starts a 2-, 3- or 4-byte character, and one starting with 10 continues it. That is why a character count and a byte count can be very different: naïve is 5 characters but 6 bytes, and a single emoji is 4 bytes.
Worked example: Café in UTF-8
C, a and f are ASCII, so each is one byte: 43 61 66. The é needs working out.
Step 1: Find its code point and write it in binary
Step 2: Fill the pattern 110xxxxx 10xxxxxx from the right
Step 3: Write each byte in hex
Answer
In other forms the same bytes are 67 97 102 195 169 (decimal), Caf%C3%A9 (URL) and \x43\x61\x66\xC3\xA9 (escapes). Note that é is not the single byte E9: that is its number in the older Latin-1 encoding, and on its own it is invalid UTF-8.
UTF-8 codes for common characters
| Character | Code point | UTF-8 (hex) | UTF-8 (decimal) |
|---|---|---|---|
| A | U+0041 | 41 | 65 |
| space | U+0020 | 20 | 32 |
| no-break space | U+00A0 | C2 A0 | 194 160 |
| é | U+00E9 | C3 A9 | 195 169 |
| ñ | U+00F1 | C3 B1 | 195 177 |
| ü | U+00FC | C3 BC | 195 188 |
| £ | U+00A3 | C2 A3 | 194 163 |
| © | U+00A9 | C2 A9 | 194 169 |
| € | U+20AC | E2 82 AC | 226 130 172 |
| ’ (curly apostrophe) | U+2019 | E2 80 99 | 226 128 153 |
| — (em dash) | U+2014 | E2 80 94 | 226 128 148 |
| 中 | U+4E2D | E4 B8 AD | 228 184 173 |
| 😀 | U+1F600 | F0 9F 98 80 | 240 159 152 128 |
UTF-8 vs Unicode vs ASCII
Unicode is the list: it gives every character a number, called a code point (é is U+00E9). UTF-8 is one way of storing those numbers as bytes (é becomes C3 A9). ASCII is the old 128-character set of English letters, digits and symbols.
UTF-8 was designed so that ASCII text is already valid UTF-8, byte for byte. That is a big reason it won: about 99% of websites use it today. Other Unicode encodings exist, mainly UTF-16, which Windows and Java use internally and which stores most characters in two bytes, but files and web pages are nearly always UTF-8.
If you need to squeeze text down to plain ASCII, for an old system that rejects accents, use the UTF-8 to ASCII converter.
How to convert a file to UTF-8
A file shows strange characters when it was saved in one encoding and opened as another. Older Windows programs often save text and CSV files as Windows-1252 (also called ANSI), which breaks accents and symbols in anything that expects UTF-8.
- Click Open file and pick the text, CSV, subtitle or other plain-text file.
- The tool reads it as UTF-8 if it can. If not, it reads it as Windows-1252 and tells you so. UTF-16 files are spotted by their first two bytes.
- Check the text in the box looks right, then click Save as UTF-8. You get a copy named
yourfile-utf8.csv.
Turn on Add BOM for Excel for CSV files you will open in Excel. The BOM is three bytes (EF BB BF) at the very start that tell Excel the file is UTF-8; without them, Excel may show Café instead of Café. Leave it off for web pages, code and data feeds, which don't need it.
Frequently asked questions
Why does é show up as é ?
The text was saved as UTF-8 (C3 A9) but read as Windows-1252 or Latin-1, where C3 is à and A9 is ©. Paste the garbled text into the UTF-8 Decode tool to turn it back into é.
What is the difference between UTF-8 and UTF-16?
Both store Unicode. UTF-8 uses 1 to 4 bytes per character and is identical to ASCII for English text. UTF-16 uses 2 or 4 bytes and is mostly used inside Windows, Java and JavaScript strings, not in files or on the web.
Can UTF-8 show every language and emoji?
Yes. UTF-8 can store every Unicode character, all the way up to U+10FFFF, which covers all modern scripts, symbols and emoji. Whether a character displays depends on the font, not on UTF-8.
Is UTF-8 the same as URL encoding?
No, but they are linked. URL encoding writes each UTF-8 byte of an unsafe character as % plus two hex digits, so é in a link becomes %C3%A9. Pick URL % in the tool to get that form.
Sources
- The Unicode Standard, chapter 3: UTF-8 byte patterns and well-formed byte sequences
- RFC 3629: UTF-8: the UTF-8 encoding and its byte ranges
- WHATWG Encoding Standard: how browsers read UTF-8, Windows-1252 and UTF-16
- W3Techs: usage of UTF-8 for websites: share of websites using UTF-8
- MDN: TextEncoder: converting text to UTF-8 bytes in the browser
Related Tools
Build and preview Valorant crosshair settings.
Search common Vim commands.
Turn JSON rows into bar, line, or pie charts.
Convert WebP files and Base64 data in both directions.
Convert GIF files and Base64 data in both directions.
Save any GIF frame, or all frames, as JPG.