UTF-8 Counter - Code Points and Byte Length
Measure UTF-8 text length
The UTF-8 counter shows code points, encoded bytes, whitespace-separated words and lines for pasted text. Its byte distribution tells you how many code points use one, two, three or four UTF-8 bytes. Use the byte total when an interface explicitly sets a UTF-8 byte limit.
Worked examples
Hellohas five code points, five UTF-8 bytes, one word and one line.Caféhas four code points and five bytes: three one-byte letters plus one two-byte accented letter.你好has two code points, six bytes and one whitespace-separated word.🚀has one code point and four bytes.A 💻 Zhas five code points, eight bytes and three words. Spaces contribute to the byte total.
Paste one example into Input Text and compare the cards with these expected results. No submit button is needed; results update while you edit. Clearing the input resets all four totals to zero.
What counts as a character?
The Characters card counts Unicode code points, rather than JavaScript UTF-16 code units or visible grapheme clusters. A single displayed symbol may contain several code points. For example, é contains an e followed by a combining accent: two code points and three bytes. The precomposed é is one code point and two bytes even though both may look alike.
The tool does not normalize these forms. Joined emoji sequences, flags and combining marks can therefore produce larger counts than the number of symbols you see. Browser TextEncoder replaces an isolated invalid surrogate with U+FFFD, which occupies three bytes.
Words, lines and percentages
Words are runs separated by whitespace after trimming the input. This is not language-aware word segmentation: a Chinese sentence without spaces counts as one word. Punctuation stays part of its run. Whitespace-only input has zero words but still consumes bytes.
Lines are separated by CRLF, CR or LF. CRLF is one line separator but two code points and two UTF-8 bytes. A final newline adds an empty final line; alpha
beta
therefore has three lines. Empty input has zero lines.
Distribution percentages describe the number of code points in each byte category, not each category's share of the total bytes. Values are rounded separately, so displayed percentages may total slightly above or below 100.
Use the right limit for your destination
This is the UTF-8 size of the text alone. A JSON request adds property names, quotes and possibly escape sequences. A downloaded file may add a byte-order mark or different line endings. Database column limits, SMS segments and social platform character limits follow their own rules; this counter does not validate them. Check the destination's documented encoding and limit before relying on this number.
Processing and troubleshooting
Counting happens in browser memory using TextEncoder. The tool does not upload the entered text to a counting API; site assets and analytics are separate page requests. It does not read files or save a text history. Very large pasted text can make the browser slow, so inspect a smaller sample when needed.
If the total differs from another application, check whether that application counts UTF-16 units, grapheme clusters, serialized bytes or a different encoding. Look for invisible spaces and a trailing newline. Use the UTF-8 encoder/decoder to inspect actual bytes, or the word counter for its separate writing metrics.
Reference: WHATWG Encoding Standard.
Guide published by SimplyUtils. View our publishing information and contact details.