How does UTF-8 variable-length character encoding work?
UTF-8 encodes Unicode code points into sequences of 1 to 4 bytes. ASCII characters (U+0000 to U+007F) use 1 byte (0xxxxxxx). Greek, Cyrillic, and Arabic use 2 bytes (110xxxxx 10xxxxxx). CJK characters use 3 bytes (1110xxxx 10xxxxxx 10xxxxxx). Emojis and rare symbols use 4 bytes (11110xxx 10xxxxxx 10xxxxxx 10xxxxxx).
What is the UTF-8 Byte Order Mark (BOM)?
The UTF-8 BOM is a 3-byte sequence (0xEF, 0xBB, 0xBF) prepended to text files. While optional in UTF-8 (since byte order is fixed), some legacy Windows tools use it to identify UTF-8 file encoding.
How do UTF-16 surrogate pairs relate to UTF-8?
Surrogate pairs (e.g. U+D83D U+DE80 for 🚀) are used in UTF-16 to represent characters above U+FFFF. UTF-8 does not use surrogate pairs—it encodes the scalar code point (U+1F680) directly into 4 UTF-8 bytes (F0 9F 9A 80).
What output formats are available in this tool?
Hexadecimal (48 65), Binary 8-Bit (01001000), Decimal (72 101), Percent-Encoded (%F0%9F), C/C++ Escapes (\x48\x65), JS/JSON Escapes (\u0048�), and Rust Byte Arrays (&[0x48, 0x65]).
What options exist for byte separators?
You can format byte streams using space (" "), comma (", "), 0x prefix (0x48, 0x65), or continuous un-spaced output.
How does the Character & Surrogate Matrix work?
The character matrix breaks down your input text line-by-line, showing the visual character, Unicode code point (U+XXXX), UTF-8 hex bytes, 8-bit binary stream, byte count, Unicode block, and UTF-16 surrogate pair.
What code snippets are generated?
The tool automatically generates copyable code snippets for C/C++ byte arrays, JavaScript Uint8Array buffers, Python 3 bytes objects, and Rust u8 slices.
Why do emojis consume 4 bytes in UTF-8?
Emojis have Unicode code points above U+10000. Under RFC 3629, code points in this range require 21 payload bits, which are split across 4 UTF-8 bytes.
Is my input text sent to any server?
No. 100% of encoding, code point analysis, BOM prepending, and snippet generation runs locally in your browser via the native Web API TextEncoder. Zero data leaves your machine.
How do I decode UTF-8 byte streams back into text?
Click the "Switch to Decode" button or navigate to /encode-decode/utf8-decode to convert hex, decimal, binary, or escaped byte sequences back into UTF-8 text.