What is a character encoding? UTF-8, ASCII, and how computers store text
By TechCompare · Updated · How we check
Use UTF-8 for every new file, API, and database column. The exception is a legacy system with a specific encoding requirement.
A character encoding is a mapping between human-readable characters and the bytes a computer stores. Without one, a byte value of 65 could mean A (ASCII), the first byte of a 2-byte Japanese character (Shift-JIS), or part of a 4-byte emoji (UTF-8). The encoding tells the computer which interpretation is correct.
How this is calculated
Before Unicode, every language had its own encoding: Latin-1 for Western European languages, Shift-JIS for Japanese, GB2312 for Simplified Chinese. A file written in one encoding would render as gibberish (mojibake) when interpreted as another. Unicode solved this by assigning a unique number (code point) to every character across all writing systems.
UTF-8 is the usual Unicode encoding because it's backwards-compatible with ASCII, space-efficient for Latin text, and capable of representing the full Unicode range. UTF-16 is used internally by Windows and Java. UTF-32 is rarely used because it wastes space.
Verdict
Use UTF-8. It stays byte-compatible with ASCII while scaling to the full Unicode range, which is why it became the dominant form. UTF-16 still powers Windows and Java internals, and UTF-32 wastes space and is barely used.
More Encoding scenarios
Related guides
Frequently asked questions
What is a character encoding?
What was mojibake before UTF-8 became standard?
Where is UTF-16 used if UTF-8 dominates?
Related tools
JSON Formatter
Validate, format, and minify JSON. Browse it as a tree, run JSONPath queries, compare two documents, or validate against a JSON Schema.
Use toolUnix Timestamp
Convert between Unix timestamps and human-readable dates.
Use toolCron Generator
Visually build standard 5-part cron expressions or translate them into readable schedules.
Use tool