Text & String Utilities100% Client-Side

Measure Text Length and UTF-8 Bytes

Paste text to see four measurements together. Characters counts Unicode code points, while UTF-8 bytes reports how much space the text needs in that encoding. The output also includes line and word counts. This is useful when a field or payload specifies a length unit and you want to see how a string with accents, emoji, or line breaks measures against it.

Input
9 chars•1 lines
Output

How to Use the Text Length and UTF-8 Byte Counter

  1. 1Paste the exact string, including any spaces, punctuation, or line breaks that should be measured.
  2. 2Read Characters for the code point count and Bytes (UTF-8) for the encoded size.
  3. 3Check Lines and Words for the other reported measures of the same input.
  4. 4Compare the matching unit with the limit used by your destination before copying the result.

Input & Output Examples

The emoji adds one code point and four bytes. The newline adds a byte and a line, and the word matches are A and 2.

Input Sample
A🙂
2
Expected Output
Characters:    4
Bytes (UTF-8): 7 B
Lines:         2
Words:         2

The accent is a separate combining code point, so the displayed letter and punctuation occupy three code points total.

Input Sample
é!
Expected Output
Characters:    3
Bytes (UTF-8): 4 B
Lines:         1
Words:         1

Practical Developer Workflows

  • Check whether a label containing emoji fits a UTF-8 byte limit.
  • Compare plain ASCII and accented sample strings that appear to have similar lengths.
  • Measure the code point and byte totals of a fixture before testing a text storage boundary.

Zero Server Uploads & Complete Privacy

Runs 100% in your browser; no data is uploaded to any server.

Notice a bug, calculation error, or outdated info?

Let us know directly so our engineering team can fix it.

Frequently Asked Questions

UTF-8 assigns one byte to each ASCII code point and multiple bytes to many other code points. A single accented letter or emoji may therefore add more bytes than characters. Use the byte count for limits specified in UTF-8.

Explore Other Tools

12 suggested tools

View all tools