Whitespace Visualizer

Whitespace visualizer that shows hidden spaces, tabs, line breaks and invisible characters.

Updated

· marks a space, → marks a tab, ↵ marks a line break, and hidden Unicode marks (zero-width characters, byte-order marks) are called out in red.

About

About the Whitespace Visualizer

Shows every space, tab and line break in your text as a visible symbol, labels non-breaking spaces and invisible Unicode characters by their code, and counts each type.

When two strings look identical but won't match, or a config file fails on a line that looks fine, an invisible character is usually to blame. The common culprits are a zero-width space (U+200B) copied from a web page or chat app, a non-breaking space from a word processor or PDF, or a byte-order mark (U+FEFF) at the start of a file saved by some Windows editors. This tool labels each one where it sits, so you can see which word it's attached to. Expect to see [U+200D] inside some emoji, such as family or profession emoji. That's a zero-width joiner, and it's supposed to be there.

Choose what to view about this tool

Guide

Using the Whitespace Visualizer

  1. 1

    Step 1

    Paste your text into the box. The marked-up version appears below as you type.

  2. 2

    Step 2

    Read the symbols: · is a space, → a tab, ↵ a line break, purple [NBSP] a non-breaking space, and red [U+…] an invisible character.

  3. 3

    Step 3

    Check the counters for totals of each type.

  4. 4

    Step 4

    Delete the stray characters in your original file. Pasting back from here would copy the symbols, not the original characters.

  • Spaces shown as ·, tabs as → and line breaks as ↵, each in its own colour
  • Non-breaking spaces (U+00A0) labelled [NBSP] and counted separately from normal spaces
  • Red labels for zero-width characters (U+200B–U+200F), the word joiner (U+2060) and the byte-order mark (U+FEFF)
  • Counters for spaces, tabs, line breaks, non-breaking spaces, hidden marks and total characters
  • Updates as you type or paste, with no button to press

Broken config files

Find the tab mixed into YAML indentation, or the BOM that makes the first line of a .env file fail.

Strings that won't match

A username or password copied from a web page that "looks right" but fails, often because of a zero-width space.

Copy-paste from Word or PDF

Spot non-breaking spaces and double spaces before they end up in your HTML or database.

Cleaning data imports

Check a sample of a CSV column for trailing spaces and tabs before running a big import.

Examples

Whitespace Visualizer examples

3 worked examples

01

Spotting a double space

Pasting "Hello world" shows Hello··world, with two · marks between the words instead of one, making the accidental extra space obvious.

02

Finding a stray tab

Pasting a line that starts with a tab instead of spaces shows →Hello·world at the start of the line, revealing the tab character that plain text hides, and the Tabs counter reads 1.

03

Catching a zero-width character

Pasting "Password" copied from a web page with an invisible zero-width space inside shows a red [U+200B] marker between "Pass" and "word", and Hidden Unicode marks counts 1.

FAQ

Frequently asked questions

Quick answers to common questions about the Whitespace Visualizer.

What's the difference between [NBSP] and the red [U+…] marks?

[NBSP] is a non-breaking space. It looks like a normal space but stops a line from breaking there, and often comes from Word, PDFs and web pages. The red marks are characters with no width at all, such as the zero-width space (U+200B), zero-width joiner (U+200D) or byte-order mark (U+FEFF).

Which invisible characters does it detect?

U+200B to U+200F (zero-width space, non-joiner and joiner, left-to-right and right-to-left marks), U+2060 (word joiner) and U+FEFF (byte-order mark), plus non-breaking spaces. Other special spaces, such as the thin space or the em space, aren't labelled. They show as plain gaps and aren't included in the space count.

Can it tell Windows (CRLF) line endings from Unix (LF)?

No. Browsers convert every line break in a text box to LF, so both kinds show as ↵. To check line endings, look at the status bar of a code editor like VS Code, which shows CRLF or LF for the open file.

Why do some emoji show [U+200D]?

Many emoji are built by joining simpler emoji with a zero-width joiner. A family emoji, for example, is several people joined this way. In emoji that's normal and shouldn't be removed.

Why is the total character count higher than I expected?

It counts the way JavaScript does, so most emoji count as 2, and joined emoji count as more.

How do I remove the characters it finds?

Edit your original text or file. In most code editors you can search for the character code, for example \u200B with regex search turned on, and replace it with nothing.

Still have a question? Contact us

Report a problem

Whitespace Visualizer

What went wrong?
    or paste a screenshot