Neatbo.

Clean whitespace

Remove trailing spaces, optionally collapse spaces and tabs, and limit consecutive blank lines.

Browser-local processingInputTextOutputUTF-8 text (.txt)
  1. 1Add input
  2. 2Adjust settings
  3. 3Get your result

Tool input and files are processed in this browser without being uploaded.

Your input
0 characters · 0 bytes
Options

Complete the required options first. You can keep the defaults for the rest.

Remove tabs and Unicode space separators from the ends of text lines. Turn this off to keep meaningful trailing spacing; blank-only lines still become empty.

Replace each run of ordinary spaces or tabs with one space, including leading indentation. Check aligned text before using the result.

Use a whole number from 0 to 100. Blank uses 1; 0 removes blank-only lines. The maximum applies to every run, including leading and trailing blank lines.

Inputs are kept temporarily in this tab when switching tools. Refreshing or closing clears them; large results may need to be regenerated.⌘ / Ctrl + Enter to run

Preparing the tool…

Before you start

Tidy pasted text with three separate options. By default, line-end spaces and tabs are removed, repeated spaces inside lines are left alone, and at most one blank line is kept in each run. Choose your settings, then run the tool and compare the spacing.

How to use this tool

  1. Paste text into “Text”, or load the example to try it.
  2. Set the two checkboxes and a whole-number blank-line maximum, then select “Clean whitespace”.
  3. Compare paragraph gaps and indentation. Use “Copy result” or download result.txt to keep the complete text.

Supported inputs and limits

Paste up to 1 MiB (1,048,576 UTF-8 bytes), including spaces and line breaks. There is no file import. Empty input is allowed and can produce an empty result.txt file.

Trailing cleanup removes tabs and Unicode space separators at line ends. Collapsing replaces runs of ordinary spaces and tabs with one space, including indentation. Blank-only lines are treated as empty even when both checkboxes are off; the blank-line limit applies at the start, between text lines and at the end.

Set the blank-line maximum to a whole number from 0 to 100; leaving it blank uses 1. Zero removes blank-only lines and keeps breaks between the remaining text lines. Input containing only whitespace gives an empty result at 0 or 1; higher values can retain line breaks.

Worked example

Example input

A  


B	 
Example options
{}

Example output

A

B

When something does not work

Keep the original text. Turn off space/tab collapsing if indentation changes, or raise the blank-line maximum if you need larger gaps. Use a whole number from 0 to 100 and shorten input above 1 MiB. Edits, cancellation or a form validation error may leave the previous result visible; an actual processing failure clears it. Run again before using a retained result.

Frequently asked questions

Where is my pasted text processed?

The tool runs locally in your browser. Switching tools can keep a temporary workspace in the same tab, within cache limits; refreshing or closing the tab clears it. Keep your original text and save any result you need.

What should I check in this result?

Check indentation, alignment and Markdown line breaks: collapsing spaces and tabs also changes leading indentation, and trailing-space removal can remove the two spaces used for a Markdown hard break. This tool caps blank-line runs rather than joining wrapped text into paragraphs. It uses the first CRLF, CR or LF style it receives; pasting may normalize line breaks before processing.

Why does the preview show only part of a long result?

The preview shows at most 4,000 Unicode code points. “Copy result” and result.txt contain the complete cleaned text. “Output details” contains JSON with input and output code-point counts.

Documentation & further reading

Related tools