← All blog posts

Character Counter explained with worked examples

WhiteUI · A plain-English guide to the Character Counter

The Character Counter gives four numbers for any text: characters with spaces, characters without spaces, words and lines. The rules behind them are short, but spaces, tabs and line breaks all count in one number and vanish in another. The five examples below use real texts and the exact counts the tool gives for them, so you can check your own results against them.

At a glance

140 of a 160-character SMS080160140 characters, 20 to spare
The sample text message is 140 characters, which leaves 20 spare under a 160-character SMS limit.

Example 1: the default, two lines

Open the tool and it already holds “Hello, world!” on one line and “This is a second line.” on the next. The count is 36 characters, 30 without spaces, 7 words and 2 lines. The first line is 13 characters, the line break is 1, and the second line is 22, which adds to 36. The 6 whitespace characters are the 5 spaces and the 1 line break.

Example 2: one line, with and without punctuation

Take the first line on its own, “Hello, world!”, and the count is 13 characters, 12 without spaces, 2 words and 1 line. Drop the comma and the exclamation mark to get “Hello world”, and the count falls to 11 characters, 10 without spaces, 2 words and 1 line. Punctuation counts, one character at a time, and two marks of punctuation are two characters.

Example 3: three short lines

Type three lines: “Line one”, “Line two” and “Line three”. The count is 28 characters, 23 without spaces, 6 words and 3 lines. The lines are 8, 8 and 10 characters long, which adds to 26, and the 2 line breaks bring the total to 28. The 5 whitespace characters are the 3 spaces and the 2 line breaks, and 28 minus 5 is 23.

Example 4: a text message under the 160 limit

A message that reads “Hi Priya, the plumber will come on Saturday between 10 and 12. Please keep the back gate open and leave the keys with the neighbour. Thanks!” is 140 characters, 115 without spaces, 26 words and 1 line. It leaves 20 characters spare under a 160-character SMS limit, and the 25 spaces in it are part of the 140, not extra.

Example 5: a bio under the 150 limit

A bio that reads “Front-end developer from Hyderabad. I build fast, accessible websites with React and plain JavaScript, and I write about what I learn along the way.” is 148 characters, 125 without spaces, 24 words and 1 line. It fits a 150-character bio limit with 2 to spare, but with 25 to spare if the limit counts without spaces.

Why the two character counts differ

The with-spaces count is the length of the text as it stands, and the without-spaces count is the same text with every whitespace character taken out. For the default text the gap is 6, for the text message it is 25, and for the bio it is 23. The gap is always exactly the number of spaces, tabs and line breaks in the text.

The common mistake

People paste a text, read the big number, and assume it is the number their limit wants. A limit that says “excluding spaces” wants the smaller number, and for the bio above that is 125, not 148. Read the line under the big number before you decide whether your text fits.

Frequently asked questions

What is the difference between the two character counts?

The with-spaces count includes every space, tab and line break; the without-spaces count removes them. For the default text that is 36 against 30.

Does punctuation count as a character?

Yes. “Hello, world!” is 13 characters, while “Hello world” is 11 — the comma and the exclamation mark add 2.

Does a line break count as a character?

Yes, in the with-spaces count. A line break is one character, like a space, so a two-line text has one more character than the two lines added separately.

How many characters is a typical text message?

The sample message in this guide is 140 characters, which leaves 20 spare under a 160-character SMS limit.

More guides on the Character Counter

Try it yourself

Try the Character Counter — free, in your browser.

Open the Character Counter