Coding & Information Theory

How Computers Represent Text

From ASCII to Unicode and UTF-8, how letters become numbers become bits — and how QR codes carry text of any language.

Computers represent text by turning every character into a number and storing that number in binary — a journey that runs from 1960s ASCII through modern Unicode and UTF-8. That same chain of ideas is what lets a QR code carry an English link, a Japanese slogan, or an emoji.

Deep down, a computer has no idea what a letter is. It only stores numbers. So how does "hello" survive being typed, saved, sent, and shown again on a different device? Through a series of agreements about which number means which character. Let's follow text from the simplest scheme to the global one — and see how QR codes ride along. 🐾

How does a computer store a letter?

A computer stores text by assigning each character a number, then storing that number as binary bits. The letter "A" might become the number 65, and 65 becomes the bit pattern 01000001. The rulebook that maps characters to numbers is called a character encoding, and it's just a shared agreement — the same principle behind all encoding.

Everything downstream depends on both ends using the same rulebook. Type "A," store 65, and as long as the reader also agrees that 65 means "A," the letter survives the round trip intact. Change the rulebook halfway and you get gibberish.

What is ASCII?

ASCII (the American Standard Code for Information Interchange) was the early, hugely influential answer. It's a 7-bit encoding, meaning each character is a number from 0 to 127 — 128 possibilities in total. That covered the uppercase and lowercase English letters, the digits 0–9, common punctuation, and a set of invisible control codes like "newline" and "tab."

ASCII was simple, compact, and good enough for English-language computing for decades. Because 7 bits fit neatly inside a byte (8 bits), each ASCII character took one byte to store, with a bit to spare. But 128 characters is nowhere near enough for the world's writing — no accented letters, no Greek, no Chinese, no emoji.

Why wasn't ASCII enough?

The world writes in far more than 128 characters. Early attempts to stretch ASCII used the spare eighth bit to add another 128 slots, producing dozens of incompatible "code pages" — one for Western European accents, another for Cyrillic, and so on. The same number meant different characters depending on which code page you assumed, so text sent between regions frequently turned to nonsense.

What the world needed was one universal catalogue where every character — from every language, plus symbols and emoji — had a single, unambiguous identity. That catalogue is Unicode.

ASCII gave every English character one number. Unicode gives every character in every writing system one number. UTF-8 is the clever way to store those numbers efficiently.

What is Unicode?

Unicode is a giant, universal character set that assigns every character a unique number called a code point. The Latin "A," the Greek "Ω," the Japanese "あ," and the 😀 emoji each get their own code point, and that identity never changes across systems or languages.

Importantly, Unicode is a catalogue, not a storage format. It says "this character is code point number such-and-such," but it doesn't dictate how to pack that number into bytes. And to stay compatible with the past, Unicode's first 128 code points are identical to ASCII — so plain English text has the same numbers in both. The question of how to actually store those code points is where UTF-8 comes in.

What is UTF-8 and why did it win?

UTF-8 is the dominant way to store Unicode code points as bytes, and it's a genuinely elegant design. It's a variable-length encoding: common characters take fewer bytes, rarer ones take more.

  • The original ASCII characters take just 1 byte each — so any plain-English text is automatically valid UTF-8, unchanged.
  • Most other common characters, including accented Latin letters, Greek, Cyrillic, and Hebrew, take 2 bytes.
  • Characters like Chinese, Japanese, and Korean typically take 3 bytes.
  • Emoji and rarer symbols take 4 bytes.

UTF-8 won the web for good reasons: it's fully backward-compatible with ASCII, it wastes no space on English-heavy text, yet it can represent every character in Unicode. Today the overwhelming majority of web pages are served as UTF-8. It's the quiet universal standard that lets a page mix languages freely.

How do QR codes carry text?

A QR code stores bits, so to carry text it needs a character encoding just like any computer. The QR standard defines several encoding modes tuned for different content — a numeric mode for digits, an alphanumeric mode for a limited set of uppercase letters and symbols (efficient for things like uppercase URLs), and a byte mode for arbitrary data.

That byte mode is the key to multilingual text: it commonly carries UTF-8, which means a QR code can hold any Unicode character — Japanese, Arabic, emoji, all of it — exactly as a web page would. When your scanner reads a code containing non-English text and shows it correctly, it's decoding those UTF-8 bytes back into code points and then characters. The details live in QR code encoding modes and character encoding and QR codes.

Why does the encoding mode matter for capacity?

Different modes cost different numbers of bits per character, so the encoding directly affects how much fits in a code. Pure digits pack tightly; the restricted alphanumeric set is fairly efficient; full UTF-8 byte mode is the most flexible but uses more bits per character, especially for multi-byte scripts.

This is why a QR code holding a short English URL can stay small and sparse, while the same-size code holding a paragraph of Chinese must be denser or larger. The trade-off between what you encode and how much room it takes is spelled out in QR code data capacity. Choosing the right mode for your content keeps codes small and easy to scan.

Text representation in one sentence

Computers store text as numbers in binary, using shared encodings that grew from 7-bit ASCII to universal Unicode code points stored efficiently as UTF-8 — the same scheme QR codes use in byte mode to carry any language on Earth.

Want to encode text of your own into a scannable grid? You can create a free QR code with QR Puppy — it handles multilingual text and emoji with no fuss.

Frequently asked questions

What's the difference between Unicode and UTF-8?

Unicode is the catalogue that gives every character a unique number called a code point, while UTF-8 is a specific way to store those numbers as bytes. Unicode says what a character's identity is; UTF-8 decides how many bytes it takes to save it.

Is ASCII still relevant?

Very much so. Its first 128 characters are identical to Unicode's, and UTF-8 stores them in a single byte, so all plain-English text is automatically valid UTF-8. ASCII lives on as the compatible core of modern encoding.

Can a QR code hold non-English text?

Yes. Using byte mode with UTF-8, a QR code can carry any Unicode character, including Chinese, Arabic, and emoji. The scanner decodes the UTF-8 bytes back into the original characters just like a web browser does.

Why does the same character sometimes appear as garbled symbols?

Because the reader used a different encoding than the writer intended, so the numbers were interpreted with the wrong rulebook. Agreeing on UTF-8 across systems is what prevents this common "mojibake" problem.

Does multilingual text make a QR code bigger?

It can. Non-English characters often take multiple bytes in UTF-8, so a code holding them carries more bits and becomes denser or needs a larger version than the same amount of plain English text.

Make a QR code the honest way 🐾

Free forever, no tracking, no expiry — generated right in your browser.

🎨 Create a QR code →