Charset
A character set (charset) is the mapping table from characters to code points; together with an encoding form (such as UTF-8) it determines how text becomes a byte stream.
Purpose
It establishes the correspondence between characters and numbers so that computers can store, transmit, and render text.
Mechanism
The character set defines the mapping from characters to code points (e.g., U+4E2D is the code point of a common Han ideograph); the encoding form defines how code points become bytes (e.g., UTF-8 uses 3 bytes). The HTTP Content-Type charset parameter declares the encoding form.
Use cases
- Character encoding declaration for web pages
- Charset settings for database columns
- File encoding detection and conversion
- Encoding of protocol text fields
Examples
- Input
Content-Type: text/html; charset=utf-8OutputThe browser decodes the page as UTF-8Declaring the encoding form
Common errors
- Confusing a character set (e.g., Unicode) with an encoding form (e.g., UTF-8)
- Keep them distinct: the character set defines code points, the encoding form defines bytes
Related terms
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
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-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. 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
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
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
Unicode Converter
Convert text to Unicode code points, UTF-8 hex, or UTF-16 hex online. Free, private, and 100% client-side. TOOL
HTML Charset Detect
Detect charset from HTML meta tag. TOOL