How the Whitespace Visualizer Works
AnyTool Whitespace Visualizer analyses text entirely in the browser. It tokenises each line into typed runs — visible text, spaces, tabs, non-breaking spaces, other Unicode spaces, and zero-width or bidirectional characters — and records each run’s position so it can be rendered with a distinct marker. Line endings are detected per line by scanning for carriage return and line feed sequences, distinguishing LF, CRLF and a lone CR, and indentation is classified from the leading whitespace of every line.
- Text is split into lines, then into typed whitespace/visible/hidden runs
- Spaces render as ·/␣, tabs as →/⇥ at a selectable width (2, 4 or 8)
- Line endings classified as LF (Unix), CRLF (Windows) or CR (classic Mac)
- Leading indentation classified per line as tabs, spaces, mixed or none
- All analysis is client-side JavaScript — no server round-trip
