Whitespace Counter

Count the spaces, tabs and line breaks in your text and find the invisible characters hiding in it. The whitespace counter makes every space visible, flags double spaces, trailing spaces, non-breaking spaces and zero-width characters, and fixes them in one click.

  • Shows hidden characters
  • Finds double spaces
  • One-click fixes with undo
0 words · 0 characters
Stays on this device

Whitespace made visible

Your text with every space, tab and line break shown. Hover or tap a mark to see exactly which character it is.

  • Space ·
  • Tab →
  • Line break ¶
  • Non-breaking space °
  • Other Unicode space
  • Invisible character ¦
  • Double space
  • Trailing space

Your text appears here with the matches highlighted.

How to count spaces and whitespace

Finding every space, tab and hidden character takes three steps.

  1. Paste your text

    Text copied from a website, a PDF, a chat app, a spreadsheet or code. The counts update as you type.

  2. See the whitespace

    Your text is shown with every space as ·, every tab as →, every line break as ¶ and hidden characters in red. Hover over a mark to see exactly which character it is.

  3. Fix what you find

    Fix double spaces, trim spaces at the end of lines, turn special spaces into normal ones, or remove invisible characters. Undo is one click away.

Example

The sample looks like ordinary text, but it hides a double space, a tab, three non-breaking spaces, a zero-width space and a line ending in spaces.

Check a sample text

Types of whitespace and hidden characters

Unicode defines 25 whitespace characters, and a few more characters are invisible without being whitespace. These are the ones you’re most likely to meet.

CharacterCode pointShown asWhere it comes from
SpaceU+0020·The space bar
TabU+0009→The Tab key, code, data pasted from spreadsheets
Line break (LF)U+000AEnter on Mac, Linux, phones and the web
Line break (CR+LF)U+000D U+000AEnter on Windows; counted as one line break
Non-breaking spaceU+00A0°Word processors, web pages ( ), French punctuation
Ideographic spaceU+3000·Chinese and Japanese text
Zero-width spaceU+200B¦ in redWeb pages and apps, to allow line breaks; not whitespace
Byte order markU+FEFF¦ in redThe start of some text files
Soft hyphenU+00AD¦ in redHyphenation hints from word processors

Why hidden spaces cause problems

Invisible characters are harmless in a paragraph but cause real trouble elsewhere:

  • Search and find miss matches: a word with a zero-width space inside doesn’t match a search for the same word typed normally.
  • Spreadsheets treat “London” and “London ” (with a trailing space) as two different values, which breaks lookups and duplicates.
  • Code and data files fail to run or import when a non-breaking space or a byte order mark sits where a normal space or nothing should be.
  • Character limits are used up by spaces you can’t see.

The whitespace counter shows each of these as a mark you can hover over, and Remove invisible characters deletes them. Zero-width joiners inside emoji and in Arabic-script or Indic writing are kept, because they’re part of the text.

One space or two after a full stop?

Two spaces after a full stop is a habit from the typewriter era. Modern style guides use one: the Chicago Manual of Style says “a single character space, not two spaces, should be left after periods at the ends of sentences”, and most publishers ask for single spacing.

Fix double spaces replaces any run of two or more spaces between words with one space. Spaces at the start of a line, used for indenting, are left alone.

What the whitespace counter shows

Every kind of space, counted separately.

  • ·

    Spaces and tabs

    Normal spaces and tab characters, counted separately.

  • Line breaks

    Every line break, with Windows CR+LF counted once.

  • °

    Special spaces

    Non-breaking spaces and other Unicode spaces that look normal but aren’t.

  • ¦

    Invisible characters

    Zero-width spaces, joiners, byte order marks, soft hyphens and direction marks.

Whitespace counter FAQ

How do I count the spaces in my text?

Paste your text into the box. The number of spaces, tabs and line breaks appears straight away, and the text is shown below with every space visible.

What is whitespace?

Characters that show as empty space: spaces, tabs, line breaks and special spaces such as the non-breaking space. Unicode lists 25 whitespace characters.

What is a zero-width space?

An invisible character (U+200B) that marks where a line may break. It takes up no space, so you can’t see it, but it can break searches, links and data.

How do I remove double spaces?

Press “Fix double spaces”. Every run of two or more spaces between words becomes one space. Undo brings back the original.

Does a line break count as whitespace?

Yes. Line breaks are whitespace characters. A Windows line break (CR+LF) is two characters but counted here as one line break.

What is a non-breaking space?

A space (U+00A0) that stops a line from breaking between two words, such as “10 km”. It looks like a normal space, so it’s shown as ° here.

Is my text uploaded?

No. Everything is checked in your browser and nothing is sent anywhere.

Sources and references

  1. Whitespace character, Wikipedia
  2. Sentence spacing, Wikipedia
  3. Unicode Text Segmentation (UAX #29), Unicode Consortium