Developer
UTF-8
UTF-8 is a variable-width Unicode encoding that represents every character in one to four bytes and is fully backwards compatible with ASCII.
Updated 12 Aug 2026
One encoding for every language
UTF-8 encodes Unicode code points using between one and four bytes. Code points below 128 use a single byte identical to ASCII, so every ASCII file is already valid UTF-8. Higher code points use lead bytes that announce the sequence length, followed by continuation bytes.
| Range | Bytes | Example |
|---|---|---|
| U+0000–U+007F | 1 | A, 9, newline |
| U+0080–U+07FF | 2 | é, ß, Ω |
| U+0800–U+FFFF | 3 | €, 中, ह |
| U+10000–U+10FFFF | 4 | emoji, rare scripts |
Why it won
- No wasted space for English or markup-heavy content
- Self-synchronising — a parser can find character boundaries from any position
- No byte-order ambiguity, unlike UTF-16 and UTF-32
- Existing ASCII tooling keeps working unchanged
Because characters vary in width, count code points or grapheme clusters rather than bytes when limiting input length — otherwise a name with an emoji can be truncated mid-character.
Base64 Encoder
Encode text to inspect the exact bytes a character produces.
Characteristics
- Variable width: one to four bytes per character
- Superset of ASCII for the first 128 code points
- Self-synchronising and byte-order independent
- Default encoding for HTML, JSON and most modern APIs
Common uses
- Web pages, JSON payloads and source files
- Database storage of multilingual text
- Filenames and log output on modern operating systems
- Any interchange format where language coverage matters
Advantages
- Complete Unicode coverage in a single scheme
- Compact for Latin script and structured text
- Compatible with the huge base of ASCII-oriented tooling
- No endianness problems
Limitations
- Less compact than UTF-16 for East Asian text
- Random access by index requires scanning
- Invalid byte sequences must be handled explicitly
- String length in bytes rarely matches what users perceive
Examples
"Hi €5 😀"
H -> 48 (1 byte)
€ -> E2 82 AC (3 bytes)
😀 -> F0 9F 98 80 (4 bytes)Frequently asked questions
What is UTF-8 used for?
Encoding text for the web, files, databases and APIs so any language can be represented reliably.
Is ASCII valid UTF-8?
Yes. The first 128 code points are byte-identical, so every ASCII file is already UTF-8.
UTF-8 or UTF-16?
UTF-8 for interchange and storage. UTF-16 only appears in specific runtimes such as Java and JavaScript strings in memory.
How many bytes is an emoji?
Usually four, and composite emoji made of several code points can be considerably more.
Does UTF-8 need a byte-order mark?
No. It has no byte-order ambiguity, and the mark can confuse parsers.
Related terms
Character Encoding
Character encoding is the mapping between the characters people read and the bytes computers store, defining how text is turned into binary and back again.
Base64
Base64 is an encoding scheme that represents binary data using 64 printable ASCII characters so it can travel safely through text-only channels.
URL Encoding
URL encoding, also called percent-encoding, replaces characters that have a special meaning or are unsafe in a URL with a percent sign followed by their hexadecimal byte value.
JSON
JSON is a lightweight text-based data format commonly used to exchange structured data between applications and APIs.
Minification
Minification removes every byte a machine does not need — whitespace, line breaks, comments and long names — from code or data without changing what it does.
Cron Expression
A cron expression is a compact string of time fields that tells a scheduler exactly when a recurring job should run.
Related tools
Related guides
Base64 Explained: What It Is and When to Use It
How Base64 turns binary into text, why output is about 33% larger, where padding comes from, URL-safe variants, and why Base64 is encoding rather than encryption.
Why Does Compressing an Image Make It Bigger?
When image compression increases file size: re-encoding optimized JPEGs, PNG for photos, quality/format mismatches, and Max quality with no downsampling. How Image Compressor warns instead of faking a win — and what to try next.
URL Encoding Explained (Percent-Encoding)
Why URLs need encoding, which characters are reserved, the difference between encodeURI and encodeURIComponent, plus and space confusion, and how to avoid double encoding.
How to Merge PDF Files Without Uploading Them
Combine several PDFs into one document: how merging works, how to control page order and orientation, what breaks bookmarks and forms, and how to do it without uploading files.