All guides

Unicode and UTF-8: Every Alphabet in One System

The problem Unicode had to solve

ASCII handles English with 128 codes. The rest of the world was left with a patchwork of regional code pages, each assigning the upper 128 values of a byte to different letters, so a file written in one region displayed as gibberish in another. Unicode replaced the patchwork with a single catalogue: every character in every script, plus symbols and emoji, gets one unique code point, written like U+00E9 for e with an acute accent. The catalogue now holds over 149,000 characters and room for more than a million. But a catalogue is not a storage format. Storing every character in the four bytes a full code point could need would quadruple the size of plain English text.

UTF-8: the variable length trick

UTF-8 stores each character in one to four bytes depending on its code point. The first 128 characters, the whole ASCII set, take one byte each and are byte for byte identical to ASCII, which is why old files just work. Accented European letters take two bytes, most Asian characters take three, and emoji take four. The byte patterns are self synchronising: a reader landing mid stream can tell from the first bits of a byte whether it starts a character or continues one, so a single damaged byte ruins at most one character. This design, from 1992, is why UTF-8 quietly won: it is now the encoding of well over 95 percent of web pages.

What this means in daily computing

File sizes depend on language: a novel in English stores at about one byte per character, in Chinese at about three. Counting characters and counting bytes become different jobs, which is why text tools report both and why a database limit in bytes can bite non English text sooner than expected. It also explains classic glitches: text saved as UTF-8 but read as an old code page shows pairs of odd characters where one accented letter should be. When you use the ASCII converter here, characters beyond the table show their Unicode values above 127, a small window into the bigger system that the world's text now lives in. A practical consequence for anyone building forms, databases or filenames: always choose UTF-8 explicitly where a system offers the choice, because the default is not always the modern one. An old database default can store English perfectly for years and then mangle the first customer whose name has an accent, at the worst possible moment. The cost of choosing UTF-8 from the start is zero. The cost of migrating later, with the mangled data to untangle, is very much not.

Try the calculator

The free tool that goes with this guide:

Convert text to codes