String Length Counter

Count characters, characters without spaces, bytes, words, and lines in any text, in your browser.

Independently verified for accuracy

Calculator by Toolsloft ↗
Characters
13
Characters (no spaces)
12
Bytes (UTF-8)
13
Words
2
Lines
1

Count the length of any text as characters, characters without spaces, UTF-8 bytes, words, and lines. It counts real characters, so an emoji or an accented letter counts as one character even though it takes more than one byte. Useful for form limits, meta tags, tweets, and database fields.

How this is calculated

Characters are counted as Unicode code points, so multi-byte symbols count as one. The byte count is the UTF-8 encoded length. Words are runs separated by whitespace after trimming, and lines are the number of newline-separated segments, treating CRLF, CR, and LF the same.

How to use

  1. Type or paste your text into the box.
  2. Read the character, byte, word, and line counts below.
  3. Watch the counts update as you edit.

Examples

  • Plain text: "Hello, World!" → 13 characters, 2 words
  • With an emoji: "café ☕" → 6 characters, 9 bytes

FAQ

Why can the byte count be larger than the character count?
Characters are counted as code points, but the byte count uses UTF-8. Accented letters and symbols such as emoji take more than one byte, so the byte count can be higher.
How are words counted?
A word is a run of non-whitespace characters. Leading and trailing spaces are ignored, and multiple spaces between words count as a single separator.
How are lines counted?
Lines are the number of newline-separated segments. An empty box counts as one line, and Windows, Mac, and Unix line endings are all treated the same.

Embed this calculator

Add this free calculator to your own site. Copy the code and paste it where you want it to appear.