Remove Blank Lines & Trim Whitespace

A lightweight text cleanup tool for removing empty lines, trimming stray spaces, and normalising repeated whitespace. Everything runs locally in your browser, nothing is uploaded.

How to use

  • Tooltips available on hover for checkboxes and buttons
  • Click Copy to copy the result, or the download icon to save it as a .txt file.

What each option does

  • Remove blank lines: Deletes every line that is empty or contains only spaces/tabs.
  • Merge blank lines: Turns multiple consecutive blank lines into a single one. Great for cleaning up log files or exported reports.
  • Trim each line: Strips leading and trailing whitespace from every line, but keeps inner spaces intact.
  • Trim top/bottom blanks: Removes blank lines and whitespace from the very start and end of the whole text.

FAQ

  • Q: Does "Remove blank lines" also strip spaces from non-blank lines?
    A: No, it only deletes lines that are fully empty or contain nothing but whitespace. Content lines stay exactly as they are.
  • Q: What is the difference between "Merge blank lines" and "Remove blank lines"?
    A: Merge keeps one blank line between paragraphs (great for readable text), while Remove deletes every blank line. You can run them in sequence — Merge first, then Remove — for the combined effect.
  • Q: Does it handle all three line-ending styles?
    A: Yes — \r\n (Windows), \n (Unix/Linux/macOS) and \r (old Mac) are all recognised and normalised to \n internally.