Whitespace & Line Break Cleaner
Local ProcessingRemove spaces, trim lines, collapse runs, drop blank lines or line breaks, normalise line endings, and convert tabs and spaces.
How It Works & Processing Standards
Remove spaces, trim lines, collapse runs, drop blank lines or line breaks, normalise line endings, and convert tabs and spaces.
Tool processing runs in your browser. If you create a calculator or conversion share link, its values are included in the URL. See the privacy policy for account, analytics and advertising data.
Current Limits
- Maximum input length: 2,000,000 characters
Tidies the spaces and line breaks in text copied from PDFs or the web, eight ways. Pick one under "Task" and the result appears immediately.
What You Can Do
- Remove spaces
- Remove every space, or only those at the start and end of lines.
- Collapse spaces
- Turn runs of spaces into a single space.
- Remove blank lines or line breaks
- Drop empty lines, or join everything into one line.
- Normalize line endings and tabs
- Pick LF, CRLF or CR, and convert tabs and spaces.
How to Use Whitespace & Line Break Cleaner
- 1Choose a taskPick how you want to clean the text.
- 2Paste textFor line endings choose a format; for tabs choose how many spaces.
- 3CopyCopy the cleaned text.
Examples
Common Use Cases
- Fixing broken lines in text copied from a PDF
- Removing spaces before pasting into a spreadsheet or form
- Matching tab and space indentation in code
Frequently Asked Questions (FAQ)
When should I change line endings?
When mixing files made on Windows (CRLF) and macOS or Linux (LF), matching the format avoids version control and script problems.
Will single spaces between words be removed?
Only "remove all spaces" removes them. To keep word spacing, use "collapse spaces".
