Text Statistics

Counts characters, words, lines and UTF-8 bytes.

Text Statistics counts the characters, words, lines, and UTF-8 bytes in any text you paste in. It also reports a character count that ignores whitespace, so you can quickly check length, word totals, and byte size without leaving the browser. Useful whenever you need a fast, accurate measure of how long a piece of text really is.

Common uses

  • Check whether a string fits a length limit, like a meta description, tweet, or database column
  • Measure the UTF-8 byte size of text before storing or sending it
  • Get a quick word count for documentation, commit messages, or release notes
  • Count lines in a log snippet, config block, or pasted code
  • Compare character counts with and without whitespace when trimming content

FAQ

Is my text sent to a server?

No. Text Statistics runs entirely in your browser using the standard TextEncoder API, and nothing you type or paste is uploaded anywhere.

How are words counted?

A word is any run of non-whitespace characters, matched with the pattern \S+. So spaces, tabs, and newlines separate words, and punctuation attached to text does not split it.

What does 'Characters (no space)' measure?

It is the total character count after removing all whitespace, including spaces, tabs, and line breaks. The plain 'Characters' count includes that whitespace.

Why might the byte count be larger than the character count?

Bytes are measured as UTF-8, where non-ASCII characters such as accented letters or emoji take more than one byte. Plain ASCII text will have equal character and byte counts.

How are lines counted?

Lines are counted by splitting on the newline character (\n), so the total is the number of newline-separated segments. A single line of text with no line breaks counts as one line.

Related tools

  • ASCII Art (Figlet)
  • Deduplicate Lines
  • Find & Replace
  • Strip HTML Tags
  • Remove Invisible Characters
  • Leetspeak
  • Morse Code
  • Pad / Truncate Lines