Whitespace Visualizer

Paste text or open a file. Every space, tab and line ending is drawn in, and characters you cannot see are named, so you can find what is breaking your code or your data.

How it works

Each kind of whitespace gets its own mark: · for a space, → for a tab, ↵ for a line feed (LF) and ␍↵ for a Windows line ending (CRLF). No-break and other unusual spaces are marked ⍽. Zero-width characters, the byte order mark, soft hyphens and the controls that change text direction are shown as a red box with their code point. Hover any mark for its name.

Above the view is a count of each kind, plus the lines that end in spaces or tabs and the lines whose indent mixes tabs and spaces.

A text box in a browser turns every line ending into LF as you paste. To check line endings, use Open a file: the file is read on this device exactly as saved, byte order mark included, and is not uploaded.

How to use it

  1. 1 Paste your text into the Text box, or press Open a file.
  2. 2 Read the counts and look for red boxes and ⍽ marks in the view.
  3. 3 Under Clean it up, choose what to fix and which line endings you want.
  4. 4 Copy the cleaned text, or download it as a file with the same name.

Good to know

  • A zero-width space copied from a web page is a common reason two strings that look the same do not match. It shows here as U+200B.
  • A byte order mark (U+FEFF) at the start of a CSV or JSON file can make the first column name or the parser fail. Open the file to see it.
  • Removing invisible characters keeps the joiner inside emoji such as a family or the rainbow flag, so those stay whole.
  • Python 3 refuses an indent that mixes tabs and spaces inconsistently with a TabError. The mixed-indent lines listed here are the place to look.

Browser support

  • Chrome 94 and later
  • Firefox 93 and later
  • Safari 16.4 and later
  • Edge 94 and later

These are the oldest versions with everything the tool uses. They are worked out from the tool itself, so they change when it does.

Version numbers checked on 2026-09-04.

Two strings that look the same and are not: finding the character you cannot see

A login fails for one user. A lookup in a spreadsheet returns nothing for a name that is plainly in the list. A config value that looks right is rejected. Very often the cause is a character that draws nothing on screen. Text copied from a web page, a PDF, a chat app or a word processor brings these characters with it, and an editor that shows only letters will never show you the difference between the two strings.

Take the name "Ann Lee" pasted from a web page. In the view above it might show as Ann⍽Lee, because the gap is a no-break space, U+00A0, not an ordinary space, U+0020. A database compares the two byte by byte, so "Ann Lee" typed by hand does not match. Or it might show Ann·Lee followed by a red box reading U+200B, a zero-width space that came along from the web page. Turning on the first two fixes under Clean it up changes the no-break space to a plain space and removes the zero-width one, and the cleaned text matches.

Line endings are the other usual suspect. Windows ends a line with two characters, a carriage return and a line feed, written CRLF. Linux and macOS use the line feed alone, LF. Most programs accept both, but a shell script with CRLF fails on Linux with an error about a "bad interpreter", and a diff of two files that differ only in line endings shows every line as changed. There is one catch when checking this in a browser: the HTML standard makes a text box turn every line ending into LF, so pasting cannot show you CRLF. Opening the file reads it as saved, and the view marks each CRLF as ␍↵.

Some invisible characters change how text is shown, not just what it contains. The bidirectional controls, such as U+202E, the right-to-left override, can make code display in a different order from the order a compiler reads it. In 2021 researchers showed this could hide malicious logic in source code that looked harmless in review, an attack they called Trojan Source. A red box in the middle of a code line is worth a careful look.

The view has limits. It names the characters people most often go hunting for, not every character in Unicode, and a few rare spaces are shown with a generic mark. It draws the first 20,000 marks of a very long text, although the counts cover all of it. A file is read as UTF-8, so a file saved in an older encoding such as Windows-1252 may show its accented letters as replacement characters. And cleaning only does what you ask: it does not touch tabs inside a line, change the indent, or decide whether a no-break space was meant to be there.

Frequently asked questions

Why does my pasted text show LF when the file has CRLF?

Browsers change every line ending in a text box to LF, as the HTML standard requires. Pasted text has lost its CRLF before this page can see it. Use Open a file instead, which reads the file as saved.

What is a no-break space?

U+00A0, a space that stops a line breaking between two words. It looks exactly like a normal space but is a different character, so code and spreadsheets treat it as text, not as a gap. Word processors and web pages insert it often.

Which invisible characters does it find?

Zero-width space, non-joiner and joiner, word joiner, the byte order mark, the soft hyphen, the Mongolian vowel separator, the left-to-right and right-to-left marks, and the bidirectional embedding, override and isolate controls. Control characters such as NUL or ESC are flagged too.

Which line ending should I choose?

LF for code in a git repository and for anything that runs on Linux or macOS. CRLF for files read by older Windows programs, such as Notepad before 2018, which showed an LF-only file as one long line. Keep line endings leaves them as they are.

Is my text or file uploaded?

No. The text and any file you open are read by this page in your browser and never leave your device.

Related tools

Your files are processed on your device and are not uploaded. You can verify this in your browser’s developer tools under the Network tab.