UTF-8
UTF-8 is Unicode's variable-length encoding form, using 1 to 4 bytes per code point; it is fully backward compatible with ASCII and is the de facto standard for the web and modern systems.
Purpose
It covers all Unicode code points while staying ASCII-compatible (no expansion for English), and is byte-order independent and self-synchronizing, which suits network transport.
Mechanism
The code point range determines the byte length: U+0000-007F takes 1 byte; U+0080-07FF takes 2; U+0800-FFFF takes 3; U+10000-10FFFF takes 4. The number of leading 1 bits in the first byte indicates the sequence length.
Use cases
- Default encoding of HTML / XML / JSON documents
- HTTP and email body transport
- Source code file encoding
- Default database character set
Examples
- Input
AOutput0x41An ASCII character, 1 byte
- Input
U+4E2DOutput0xE4 0xB8 0xADA BMP CJK ideograph, 3 bytes
Common errors
- Truncating a UTF-8 string mid-sequence, producing invalid bytes
- Truncate at character boundaries or use encoding-aware APIs
Related terms
Unicode
Unicode is the international character encoding standard that assigns a unique code point (U+0000 through U+10FFFF) to every character of nearly all the world's writing systems, with a codespace of 1,114,112 code points. GLOSSARY
UTF-16
UTF-16 is Unicode's variable-length encoding form, using 2 or 4 bytes per code point: BMP characters take one 16-bit code unit and supplementary-plane characters take a surrogate pair (2 code units). GLOSSARY
ASCII
ASCII (American Standard Code for Information Interchange) is a 7-bit character encoding standard that defines 128 characters (0-127), covering English letters, digits, punctuation, and control characters. GLOSSARY
BOM
The BOM (byte order mark) is the Unicode character U+FEFF, placed at the start of a text stream to indicate the encoding form and byte order. GLOSSARY
Related tools
Unicode Converter
Convert text to Unicode code points, UTF-8 hex, or UTF-16 hex online. Free, private, and 100% client-side. TOOL
Charset Reference
Reference table of character encodings. Free, private, 100% client-side. TOOL
Encoding Detector
Check text encoding: ASCII subset, UTF-8 BOM, and non-ASCII characters. Text input is always re-encoded as UTF-8, so legacy encodings (GBK/Big5/Shift-JIS) cannot be distinguished — the tool honestly reports the UTF-8 byte form. Free, private, 100% client-side. TOOL