01What is UTF-8 Encoder?
A string that looks short on screen can still blow past a byte limit, and this tool shows you exactly why. UTF-8 is the encoding defined in RFC 3629 and the Unicode Standard. It stores every Unicode code point in one to four bytes, and the number of bytes depends only on how large the code point is. When you type into the box, the tool first splits your text by code point using JavaScript's string iterator. That matters for emoji. A waving hand, U+1F44B, is one row here, even though JavaScript stores it internally as two UTF-16 code units. Each code point then goes through the browser's built-in TextEncoder, which always produces UTF-8. The table shows the character, its code point in U+XXXX form, the bytes in hex, the same bytes in binary, and the byte count. The binary column is where the design of UTF-8 becomes obvious. A single-byte character starts with 0. A lead byte starts with 110, 1110 or 11110, which tells a decoder how many bytes follow. Every continuation byte starts with 10. So a decoder dropped into the middle of a stream can always find the next character boundary. Here's a quick worked example. Type the euro sign and you get U+20AC, three bytes: 0xE2 0x82 0xAC, or 11100010 10000010 10101100 in binary. Type a thumbs-up with a medium skin tone and you get two rows, U+1F44D and the modifier U+1F3FD, four bytes each. The totals line then reads 2 chars, 8 bytes and 4 UTF-16 code units. Those three numbers are the ones that disagree between your JavaScript length check, your database column and your API limit. Above the table you always see those three counts together. The Copy button exports the rows as tab-separated text: character, code point, hex bytes and binary. The byte count column is not part of the copied text, so add it in your spreadsheet if you need it. A few honest limits. The tool splits by code point, not by what a reader sees as one character, so flags, skin tones and family emoji show up as several rows. It does not normalise text, so a precomposed letter and a base letter with a combining accent give different rows. It only encodes. It can't decode raw bytes back into text. Your text is processed by the TextEncoder in your own browser tab and is never uploaded.
Backend developers chasing byte-limit errors, DBAs moving tables to utf8mb4, localisation engineers and students learning how UTF-8 lays out its bytes. The tool runs entirely in your browser, so your data never leaves your device.
02How to use UTF-8 Encoder
- Type or paste text into the Input Text box, or pick one of the built-in examples such as Emoji or CJK characters.
- Read the totals line: chars, bytes and UTF-16 code units.
- Scan the table for each code point, its hex bytes, its binary form and the byte count in the # column.
- Click Copy to put the rows on your clipboard as tab-separated text.
- Click the reset button to clear the input and start again.
03Worked examples
- Input:
A - Result:
U+0041 | 0x41 | 01000001 | 1 byte - ASCII characters keep their single byte in UTF-8, so plain English text is the same in both.
- Input:
é - Result:
U+00E9 | 0xC3 0xA9 | 11000011 10101001 | 2 bytes - The lead byte starts with 110 and the continuation byte starts with 10.
- Input:
€ - Result:
U+20AC | 0xE2 0x82 0xAC | 11100010 10000010 10101100 | 3 bytes - A three-byte lead starts with 1110.
- Input:
你好 - Result:
Totals: 2 chars, 6 bytes, 2 UTF-16 code units. Rows: U+4F60 0xE4 0xBD 0xA0 and U+597D 0xE5 0xA5 0xBD - Most CJK characters take three bytes each in UTF-8.
- Input:
👋 - Result:
U+1F44B | 0xF0 0x9F 0x91 0x8B | 11110000 10011111 10010001 10001011 | 4 bytes - Code points above U+FFFF take four bytes, and the lead byte starts with 11110. The totals show 1 char but 2 UTF-16 code units.
- Input:
👍🏽 - Result:
Totals: 2 chars, 8 bytes, 4 UTF-16 code units. Rows: U+1F44D 0xF0 0x9F 0x91 0x8D and U+1F3FD 0xF0 0x9F 0x8F 0xBD - A skin-tone emoji is a base emoji plus a modifier, so it appears as two rows. Binary columns trimmed here.
04Common use cases
- Finding out why a MySQL column in the legacy utf8 charset rejects a comment that contains an emoji
- Checking whether a push notification or SMS body fits a limit that is counted in bytes, not characters
- Comparing the expected bytes of é (0xC3 0xA9) with a hex dump when a file shows mojibake like é
- Explaining to a teammate why "👍🏽".length is 4 in JavaScript while a user sees one symbol
- Writing byte-exact test fixtures for a parser, tokenizer or binary protocol
- Teaching the lead-byte and continuation-byte pattern of variable-length encoding in a class or workshop
05Tips
- If the UTF-16 count is higher than the chars count, your text contains code points above U+FFFF, usually emoji. That gap is what breaks naive substring code.
- MySQL's old utf8 charset stores at most three bytes per character. Any row in this table with a byte count of 4 needs a utf8mb4 column.
- To get a byte length in code, use new TextEncoder().encode(s).length. String length in JavaScript counts UTF-16 units, not bytes.
- Precomposed é (U+00E9) and e plus U+0301 look identical but give different rows. Run text through normalize('NFC') before comparing or measuring it.
- A row showing 0xEF 0xBF 0xBD means TextEncoder met a lone surrogate and swapped in U+FFFD. The source string was probably cut in the middle of an emoji.
06Related concepts
UTF-8, Unicode code points, UTF-16, TextEncoder, Mojibake, Byte order.
Frequently Asked Questions
What is UTF-8 Encoder?
UTF-8 Encoder is a free, browser-based developer tool on AIDToolStack. Encode/decode UTF-8 text to byte sequences It requires no installation or sign-up and works entirely in your browser.
Is UTF-8 Encoder free to use?
Yes. No sign-up, no fees and no usage cap.
Does UTF-8 Encoder store my data?
No. It runs in your browser; nothing is uploaded.