Whitespace Visualizer
Paste text to reveal invisible characters — spaces, tabs, newlines, zero-width characters, BOM, and more.
About This Tool
The Whitespace Visualizer is a free browser-based tool that reveals invisible characters hidden in your text. Every developer has encountered mysterious formatting issues caused by non-printable characters — tabs mixed with spaces, wrong line endings, stray zero-width spaces copied from web pages, or an unexpected byte order mark (BOM) at the start of a file. This tool makes all of these characters visible so you can identify and fix problems quickly.
The visualizer replaces each type of invisible character with a distinct visible marker. Regular spaces become middle dots (·), tabs become arrows (→), line feeds show as (↵), carriage returns appear as (←), and more exotic characters like zero-width spaces, zero-width joiners, non-breaking spaces, soft hyphens, and the BOM are each shown with clearly labeled markers. You can toggle the visibility of each character type independently using the toggle buttons at the top of the tool.
Beyond visualization, the tool provides a statistics panel that counts every type of invisible character in your text and detects the line ending style (LF, CRLF, or mixed). This is invaluable when debugging cross-platform text processing issues. If you need to count overall words and characters, try the Word & Character Counter. For transforming the case of your text, see the Text Case Converter. If you need to escape or unescape special characters in strings, the String Escape/Unescape tool can help.
The clean feature lets you select which invisible character types to remove and then apply the cleaning in one click. This is particularly useful for stripping zero-width characters, BOMs, or normalizing line endings.
All processing happens entirely in your browser. Your text never leaves your machine — there are no server round-trips, no logging, and no third-party services involved. This makes it safe to use with sensitive content such as source code, configuration files, or private documents.
How to Use
- Paste or type your text into the Text Input panel on the left. You can also click Sample to load example text containing various invisible characters.
- The Visualization Output panel on the right immediately shows your text with invisible characters replaced by visible markers, each color-coded by type.
- Use the toggle buttons above the panels to show or hide specific character types (Space, Tab, LF, CRLF, NBSP, ZWS, etc.). Click Show All or Hide All for batch control.
- Review the Line Endings section below the panels to see whether your text uses LF, CRLF, or a mix of both.
- Check the Character Statistics grid to see the count of each invisible character type found in your text.
- To remove unwanted characters, scroll to the Clean Invisible Characters section. Toggle the character types you want to strip, then click Clean to apply the changes to your input.
- Click Copy Cleaned to copy the cleaned version to your clipboard, or press Ctrl+Shift+C to copy the visualized output.
Popular Whitespace Visualizer Examples
FAQ
What invisible characters can this tool detect?
The tool detects 11 types of invisible characters: regular spaces (U+0020), tabs (U+0009), line feeds LF (U+000A), carriage returns CR (U+000D), CRLF pairs, non-breaking spaces NBSP (U+00A0), zero-width spaces ZWS (U+200B), zero-width joiners ZWJ (U+200D), zero-width non-joiners ZWNJ (U+200C), soft hyphens SHY (U+00AD), and byte order marks BOM (U+FEFF).
How do I fix mixed line endings in my file?
Paste your text into the tool and check the Line Endings section to confirm the mix. Then in the Clean section, select CRLF (or CR) and click Clean. This normalizes all line endings to LF. Alternatively, select LF and CR individually if you want to remove specific types. The tool shows you exactly what it will remove before you apply the change.
What is a zero-width space and why is it a problem?
A zero-width space (U+200B) is an invisible Unicode character that takes up no visible width but is still present in the text data. It often gets copied from web pages or rich text editors. It can break string comparisons, regular expressions, URL parsing, and code compilation. The tool marks them as [ZWS] so you can see exactly where they are, and the clean feature lets you remove them in one click.
What is a BOM and when should I remove it?
BOM (Byte Order Mark, U+FEFF) is a Unicode character placed at the beginning of a text file to indicate the byte order of the encoding. While useful for UTF-16 and UTF-32, it can cause problems in UTF-8 files, including breaking shell scripts, HTTP headers, JSON parsing, and PHP output. The tool shows [BOM] markers so you can identify and remove them if needed.
Can I use this for debugging code or configuration files?
Yes. This tool is especially useful for debugging YAML, Python, Makefile, and other whitespace-sensitive formats. You can detect tabs-vs-spaces issues, find stray non-breaking spaces that look like regular spaces but cause syntax errors, and identify hidden zero-width characters that break string comparisons.
Is my data safe?
Yes. All processing runs entirely in your browser using JavaScript. No data is sent to any server. You can verify this by checking the Network tab in your browser's developer tools while using the tool.
What do the different marker colors mean?
Each character type has a distinct color: blue for spaces, cyan for tabs, green for line endings (LF, CR, CRLF), yellow for non-breaking spaces, red for zero-width characters (ZWS, ZWJ, ZWNJ), purple for soft hyphens, and orange for BOM. This color coding makes it easy to quickly scan text and identify different types of invisible characters.
Related Tools
Word & Character Counter
Count words, characters, sentences, paragraphs, and estimate reading time with keyword frequency analysis.
Text Case Converter
Convert text between camelCase, PascalCase, snake_case, kebab-case, and other naming conventions.
String Escape/Unescape
Escape and unescape strings for JSON, JavaScript, HTML, URL, SQL, and CSV formats.
Diff Viewer
Compare two texts side by side with line-by-line and character-level diff highlighting.
Unicode Inspector
Inspect Unicode characters with code point, UTF-8/UTF-16 encoding, character name, category, and block details.
String Length Calculator
Calculate string length in characters, code points, grapheme clusters, and byte sizes for UTF-8, UTF-16, and UTF-32.