freesabai

Text tools

Remove empty lines and extra spaces

Paste text copied from a web page, a PDF or an email and clean it in one click: remove empty lines, trim spaces at the start and end of lines, collapse repeated spaces, and strip invisible characters. Choose which of these to do. It runs in your browser and the text is not sent anywhere.

This tool needs JavaScript. If you still see this after a few seconds, JavaScript is switched off in your browser or the page did not load completely: turn JavaScript on or reload the page.

How to use it

  1. Paste the text into the box on the left, or press "Open file".
  2. Tick what you want done. The result shows at once, with how many lines and characters were removed.
  3. Press "Copy" or "Download" to take the result.

Frequently asked questions

What are invisible characters, and why remove them?

Characters such as the zero-width space (U+200B), word joiner and BOM that come along when you copy from a web page or a PDF. You cannot see them, but they break searches, make text compare as different, or wrap lines in odd places. This tool removes only the safe ones and keeps the zero-width joiner that emoji and some scripts need.

Does it remove all the spaces?

No. Repeated spaces become one space between words. Spaces at the start of a line (indentation) are trimmed when "Trim spaces at the start" is ticked; untick it to keep the indentation.

Is a line of only spaces an empty line?

Yes. With "Remove empty lines" ticked, lines of only spaces or tabs are removed too.

Good to know

Your data stays on your device

Everything runs in your browser. What you type, paste or open is not sent to freesabai's servers or anyone else's, and is not kept in the browser: close the page and it is gone. The site only counts how many times this page was opened and how many times someone copied or saved a result (never what was pasted or the result, and you can switch the counting off in the footer; see the privacy policy).

Report a problem or suggest an idea

Found a bug, or want this tool to do more? Tell us on the feedback page. No sign-up.

Other text tools

Convert and edit text

Lines

Thai language

More tools for text (in the developer tools)