Collapse Consecutive Newlines (Keep One Blank Line)

Clean up pasted text by collapsing repeated blank lines without removing meaningful single line breaks.

You can also treat whitespace-only lines as blank lines and switch the úttak to LF or CRLF.

Everything runs locally in your browser. Your text is never sent to a server.

What this verkfæri does

This verkfæri is for text that became too airy after copy and paste. It keeps normal line breaks in place, compresses only runs of blank lines, and lets you choose whether to keep one blank line, keep more, or remove blank lines entirely.

How to use

  1. Paste text into the inntak area.
  2. Choose the blank-line limit and decide whether whitespace-only lines should count as blank.
  3. Click Compress, then copy or download the niðurstaða.

Examples

Keep one blank line

Inntak

Paragraph 1\n\n\nParagraph 2\n\n\n\nParagraph 3

Úttak

Paragraph 1\n\nParagraph 2\n\nParagraph 3

Remove blank lines entirely

Inntak

A\n\n\nB\n\nC

Úttak

A\nB\nC

Treat whitespace-only lines as blank

Inntak

Heading\n(space-only line)\n(tab-only line)\nBody

Úttak

Heading\n\nBody

Glossary

Blank line

A line with no actual content. This verkfæri can optionally treat whitespace-only lines as blank lines too.

Consecutive newlines

In practice, this means a run of blank lines. A single line break inside normal text is not the main target.

LF / CRLF

Two common line-ending formats. LF is typical on the web and Unix-like kerfis, while CRLF is common in Windows editors.

Algengar spurningar

Does it remove every line break?

No. By default it keeps single line breaks and collapses only repeated blank lines. If you choose Remove blank lines, it removes empty lines while keeping normal line separation between content lines.

Can it treat space-only lines as blank lines?

Yes. It is enabled by default. Lines that contain only spaces, tabs, NBSP, or full-width spaces can be compressed as blank lines.

Can it trim blank lines at the start and end?

Yes. In advanced options, switch Leading/trailing blank lines between Trim and Keep.

Can I úttak CRLF for Windows verkfæris?

Yes. Change Úttak line ending from LF to CRLF in advanced options.

Is my text uploaded anywhere?

No. The transformation happens entirely in your browser, and the verkfæri does not send your text to a server.

Athugasemdir

  • This verkfæri does not reflæði paragraphs or join single line breaks into sentences. It is intentionally focused on blank-line cleanup.
  • If Treat whitespace-only lines as blank is off, lines containing only spaces or tabs remain untouched.
  • If Trim trailing spaces is off, invisible end-of-line spacing may remain in the úttak.