Whitespace Cleaner
Runs locally in your browser. Your input is not uploaded.Free, no sign-up
Input
Output
Trim lines, remove empty lines, normalize spaces and convert tabs to spaces.
How to use the Whitespace Cleaner
- Paste text, code or configuration, or click Sample. Spaces, tabs and trailing whitespace are made visible in both editors.
- Choose what to clean. The result and a summary of the changes update instantly.
- Copy or download the cleaned text.
What each option does
- Trim trailing whitespace: removes spaces and tabs at line ends, the usual cause of noisy diffs.
- Collapse repeated spaces: turns runs of spaces inside a line into one, leaving indentation alone.
- Fix invisible characters: replaces non-breaking spaces with normal ones and removes zero-width spaces and byte-order marks, which often sneak in when copying from web pages, chat apps or Word, and break YAML, JSON and shell scripts.
- Tabs: To spaces expands tabs to the next tab stop, keeping columns aligned; Indent with tabs converts leading spaces.
- Line endings: converts between Windows (CRLF) and Linux/macOS (LF) line breaks.
Frequently asked questions
Why does my YAML fail with an invisible character?
A non-breaking space (U+00A0) looks like a space but isn't one, so YAML indentation or a key suddenly doesn't match. Fix invisible characters replaces it.
Is my text uploaded?
No. Cleaning happens in your browser.
Related tools
All tools- Line Sorter / DeduplicatorSort lines, remove duplicates and use natural or case-sensitive ordering.
- Text Case ConverterConvert text between camelCase, PascalCase, snake_case, kebab-case and more.
- Diff CheckerCompare two texts side by side or as a unified diff, with added, removed and changed lines.
- Regex TesterTest regular expressions with live match highlighting, capture groups, flags and explanations.
- Cron Expression GeneratorBuild Linux cron expressions with a visual editor and preview the next run times.