TextArray
100% local

UTF-8 byte counter

Measure the real size of text in UTF-8 bytes, UTF-16 units, code points and graphemes.

Input
Output

UTF-8 byte counter

Character count and byte size are not the same thing. In UTF-8, plain English letters take one byte each, but "é" takes two, most CJK characters take three and an emoji like 👋 takes four — so a 160-character message can easily be far more than 160 bytes. Paste any text and this counter reports its exact UTF-8 byte size, the UTF-16 code units JavaScript's .length would report, the number of Unicode code points, the grapheme count (user-perceived characters, so a 👨‍👩‍👧 family counts as one) and the number of lines, plus the stored size in B, KB or MB for both encodings.

That breakdown answers practical questions fast: will this string fit a VARCHAR(255) column measured in bytes, an SMS segment, a 64 KB payload limit, an HTTP header budget, a localStorage quota? Why does a database complain about a "160-character" string, and why does an emoji count as two characters in one system and one in another? The counter shows all the competing definitions of "length" side by side so you can see exactly which one your limit uses.

Line endings matter for byte size too: a file saved with Windows CRLF endings is one byte per line larger than the same file with Unix LF endings. The line endings option lets you measure the text as pasted, or as it would be once converted to LF or CRLF.

Everything is computed locally in your browser using the standard TextEncoder API — the text you paste is never uploaded, so config files, tokens and private messages are safe to measure.

FAQ

Why is the byte count higher than the character count?
UTF-8 is a variable-width encoding: ASCII letters take 1 byte, accented Latin letters 2, most CJK characters 3 and emoji 4. Any non-ASCII text is therefore larger in bytes than in characters.
What is the difference between code points and graphemes?
A code point is a single Unicode value; a grapheme is what a reader sees as one character. Emoji built from several code points joined by ZWJ, or letters with combining accents, are multiple code points but one grapheme.
Which number does a database column limit use?
It depends on the database and column definition — MySQL utf8mb4 VARCHAR limits count characters while many byte-based limits (Redis keys, index sizes, some APIs) count UTF-8 bytes. This tool shows both so you can check against the right one.
How do line endings change the size?
Windows CRLF endings are two bytes per line break, Unix LF endings one. Switch the line endings option to see the size of the text as it would be saved with either convention.
Is my text uploaded anywhere?
No. Counting runs entirely in your browser with the built-in TextEncoder API and your text never leaves your device.