Text Size Calculator

This text size calculator shows how many bytes your text takes in UTF-8, UTF-16 and other encodings, plus its length and rendered width, live as you type.

Text
Size and length
Stored only in this browser, for this tool. Runs locally in your browser

About the Text Size Calculator

Text has several sizes, and which one matters depends on the question. This tool measures them as you type: bytes when stored as UTF-8, UTF-16, UTF-32, ASCII or Latin-1, the length in characters as a reader sees them, Unicode code points and UTF-16 code units, words, lines, and the rendered width in pixels at a font size you choose.

Bytes are counted per encoding. UTF-8 uses one byte for ASCII and up to four for other characters, so "é" takes two and an emoji takes four. ASCII and Latin-1 can only hold some text, so when your text contains a character outside them the tool names the first one rather than guessing. Characters as you see them are grapheme clusters, counted with the browser's Intl.Segmenter, so a family emoji built from several code points counts as one. KB and MB use 1,024 bytes. Windows files store each line break as two bytes, so a CRLF total is shown when your text has line breaks.

The pixel width is measured on a canvas with your browser's own sans-serif, serif, monospace or system font, so another device can differ by a few pixels. For plain character, word and sentence counts use the Character Counter and the Word Counter; to convert a byte total between units, the Bytes Converter; and to see how a string is encoded, the UTF-8 Converter. Everything is calculated locally in your browser.

How to use

  1. Type or paste your text, or use Upload to read a text file.
  2. Read the byte size for each encoding and the character, word and line counts, which update as you type.
  3. Choose a font and size in the toolbar to see the rendered width in pixels.
  4. Copy the figures you need.

Common questions

Why is the UTF-8 size bigger than the character count?
UTF-8 stores ASCII in one byte, accented letters in two, most other scripts in three and emoji in four, so any text beyond plain English is larger than its length.
Why does it say ASCII is not possible?
ASCII holds only 128 characters. If your text has anything else, such as an accent or an emoji, the tool shows how many such characters there are and names the first.
What is the difference between code points and characters?
A code point is one Unicode value. A character as you see it, a grapheme cluster, can use several, like a letter plus an accent or a family emoji.
Is a KB 1,000 or 1,024 bytes here?
It is 1,024 bytes, and MB is 1,048,576 bytes. Divide the byte figure by 1,000 yourself if you want decimal kilobytes.
How accurate is the pixel width?
It is measured with the font your browser picks for the chosen family, so it is exact for this browser and approximate for others.