Characters vs Bytes: Why Your Text Is Bigger Than You Think
You paste a string that looks like 100 characters into a field with a 100-character limit, and it gets rejected as too long. How? The answer is that a character and a byte are not the same thing, and the gap between them — invisible until it bites you — is one of the more confusing corners of working with text. Here is what is actually going on.
The core distinction
In plain ASCII — the basic English letters, digits, and common symbols — one character is exactly one byte, so the counts match and nobody thinks about it. But the web runs on UTF-8, an encoding where characters outside that basic set take more than one byte each. An accented letter like é is two bytes. Many Asian characters are three bytes. Emoji are typically four bytes. So the number of bytes your text occupies can be much larger than the number of characters you see, depending entirely on what those characters are.
Why byte size matters
The gap matters because many limits are defined in bytes, not characters. Database fields are often sized in bytes, so a field that holds 100 bytes might only fit 50 characters if they are multi-byte. Network payloads, message size caps, and storage quotas are measured in bytes. Some APIs limit request bodies by byte size. This is exactly why text that looks well under a character limit can be rejected as too long — the limit was in bytes, and your accented letters or emoji pushed the byte count over even though the character count looked fine.
How UTF-8 assigns bytes
UTF-8 is variable-width by design. It encodes the basic Latin letters and digits in a single byte each, which keeps plain English text compact and byte-for-character identical. Beyond that, it uses two bytes for most accented Latin and Greek characters, three bytes for a large range including most Chinese, Japanese, and Korean characters, and four bytes for the rest, including most emoji and some rare scripts. So a 100-character string can occupy anywhere from 100 to 400 bytes depending on its content. A tweet of emoji is far heavier than a tweet of plain letters.
The emoji surprise
Emoji deserve special mention because they cause the most confusion. Most emoji are four bytes in UTF-8, and some — the ones built by combining several code points, like certain flags or skin-tone variants — are even more. So a single emoji can use as much byte-space as four plain Latin characters, and a compound emoji can use far more. A message that is visually short but emoji-heavy can blow past a byte limit unexpectedly. If you have ever had a short, emoji-filled message rejected, this is why.
The practical takeaway
When a limit is defined in characters — most social media post limits — count characters. When a limit is defined in bytes — many database fields, APIs, and protocols — count bytes, and remember that accents and emoji inflate the byte count. When you are not sure which a system uses and your text contains anything beyond plain ASCII, check the byte size to be safe. Seeing both numbers at once removes the guesswork and prevents the "but it looked short enough" rejection.