Find the Length of Text

Paste text and get characters, bytes and lines instantly.

The length updates as you type. Ctrl + Enter measures now.

Text length

How to find the length of text

Paste your text into Your text, or press Load example. The character, UTF-16 unit, byte and line counts appear next to it and update as you type. Copy the summary or download it as a .txt file. Everything runs in your browser, so nothing you paste is uploaded.

Examples

InputText length
hello 5 characters, 5 bytes
café 4 characters, 5 bytes
Hello, world! 😀 15 characters, 18 bytes

Limits and edge cases

MeasureWhat it countsEmoji example (😀)
Code pointsOne per visible character1
UTF-16 unitsJavaScript string length; surrogate pairs count twice2
UTF-8 bytesStorage size when UTF-8 encoded4
  • Newlines add to the line count: a single trailing line break does not create an extra line, so ab\ncd\n counts as 2 lines.
  • Empty input measures zero for every unit: 0 characters, 0 UTF-16 units, 0 bytes and 0 lines.
  • Accented characters such as é count once as a character but take 2 bytes in UTF-8.

Frequently asked questions

How do I count the characters in my text?

Paste your text into the input box and the character, byte and line counts appear instantly on the side. Press Measure length if live updates are paused for very large inputs.

What is the difference between characters and bytes?

Characters counts what you see as letters and symbols, while bytes counts how much storage the text needs when encoded as UTF-8. Plain English letters use one byte each, but accented letters and other scripts use more.

Why does an emoji count as 1 character but 4 bytes?

Emoji like the grinning face are a single Unicode character but need four bytes in UTF-8 encoding, so the tool shows 1 character and 4 bytes for one emoji.

What are UTF-16 units compared to code points?

Code points count each character once, including emoji. UTF-16 units match the JavaScript string length, where emoji built from surrogate pairs count twice. So one emoji is 1 code point but 2 UTF-16 units.

Is my text uploaded anywhere?

No. Measuring runs in your browser with JavaScript and nothing is sent to a server. Inputs under 200 KB are kept in your browser's local storage so they are still there when you come back.

Are newlines counted?

Newlines are not counted as characters beyond their own code point, but they do affect the line count. A single trailing line break does not add an extra line, so ab followed by cd on the next line counts as 2 lines.