Text desk
Remove Empty Lines
Remove blank and whitespace-only lines from pasted text.
Remove Empty Lines: Close gaps in a pasted list by deleting entries that contain nothing except whitespace. Remove Empty Lines keeps every non-blank line exactly as entered, including its indentation and trailing spaces. It suits copied lists with spacer rows when those gaps have no meaning. Runs 100% locally in your browser with zero server file uploads.
- Category
- Text tools
- Runs
- In your browser
- Cost
- Free · no sign-up
- Availability
- Ready to use
Runs entirely in your browser
Result
ReadyText is processed locally. The tool uses literal, allowlisted operations and does not execute regular expressions or code.
Blank-row predicate with an example
For each line L, keep L if trimming its edges leaves at least one character; otherwise discard it. Retained count = original logical count − blank count. Enter 10\n\n \n20\n: there are four logical entries, two of which are blank. The result is 10\n20\n, with 4 − 2 = 2 retained entries. The final LF remains because the original had one and the result still contains lines. Numbers are just text here, not values to calculate.
Whitespace rules and larger lists
The whitespace definition follows ECMAScript trimming (https://tc39.es/ecma262/multipage/text-processing.html#sec-string.prototype.trim), rather than treating every invisible Unicode character as blank. LF, CRLF and CR divide the input into logical lines; retained output is joined with LF. No alphabetic sorting, duplicate removal or locale comparison occurs. For large imports, stay within 100,000 input code points and 10,000 lines, and keep a copy before removing record spacing. The result must fit within 200,000 code points. The editor’s character allowance counts UTF-16 units, so supplementary characters such as many emoji can reduce the available input size.
How to use it
- Paste or type your lines in the local editor.
- Set the options shown for this transformation and run it.
- Review the result, then copy or download the text.
Privacy & limitations
Your text and result stay on this device. There is no upload or execution of entered code.
Related tools
Frequently asked questions
Is a line containing tabs or a non-breaking space removed?
Yes. A line made only of tabs, ordinary spaces or non-breaking spaces is considered blank. A zero-width space U+200B is different: it survives this check and can make a visually empty row remain. Inspect invisible characters when a gap refuses to disappear.
Does removing blanks also trim the lines I keep?
No. A line containing two spaces followed by a word retains those spaces. Only the decision to keep or remove a whole line uses its trimmed form. Run Trim Lines separately if you want both blank-row removal and clean edges around the remaining text.
Can this remove separators from a structured document?
It can, so use it on data where blank rows are disposable. Empty paragraphs, stanza breaks and record separators may carry meaning. The tool does not understand those formats. If every row is whitespace-only, the result is empty rather than a single final newline.
Free tool · runs in your browser · no account required