How to count the byte size of text in UTF-8 and UTF-16

A database column takes "255 characters" — but is that 255 letters or 255 bytes? For anything beyond plain English the two differ, and guessing wrong means truncated data or a rejected payload. This guide explains the gap between characters and bytes.

The fastest way

Paste or type into the Character & Byte Counter and it shows characters, Unicode code points, lines, and the exact UTF-8 and UTF-16 byte size, all updating as you type.

Characters vs bytes

In UTF-8: ASCII letters are 1 byte, accented Latin ~2, most CJK 3, and emoji 4+. That's why "café" is 4 characters but 5 bytes.

UTF-8 vs UTF-16

UTF-8 is the default for the web and files. UTF-16 is used inside Windows, Java and JavaScript strings, and some databases, where every character is at least two bytes. If a limit is defined in one encoding, counting in the other gives the wrong answer — the Byte Counter shows both so you never have to guess.

Related text tools

For essays and social limits you usually want the word and character totals instead — the Word Counter covers those. And if you're sizing text for embedding in a data URL or JSON, the Base64 Encoder shows how much the encoding inflates it (Base64 adds about a third).

A note on privacy

The Byte Counter runs locally in your browser — your text is never uploaded.

Open the Byte Counter →

Common questions

What's the difference between a character and a byte?

A character is one symbol a reader sees; a byte is one unit of storage. In UTF-8, a plain ASCII letter is one byte, but accented letters take two, most CJK characters take three, and emoji take four — so character count and byte count only match for plain English text. Byte count is what matters for storage limits, database columns, and network payloads.

Why is one emoji four bytes (or more)?

Emoji live high in the Unicode range, which UTF-8 encodes as four bytes. Some emoji are also made of several code points joined together (skin-tone modifiers, flags, family sequences), so a single glyph on screen can be eight or more bytes. The counter shows characters, code points, and bytes separately so you can see exactly where the size comes from.

When do I need UTF-16 instead of UTF-8?

UTF-8 is the web and file standard, but some systems — Windows internals, Java/JavaScript strings, and certain databases — measure length in UTF-16 units. In UTF-16 every character is at least two bytes. The counter reports both encodings so you can match whichever limit your platform uses.

Is my text uploaded?

No. The counting happens entirely in your browser as you type — nothing is sent anywhere, so pasting sensitive data to check its size is safe.