Text tool

Remove Lines Longer Than N

Paste text, set the maximum line length, and remove longer lines locally. Line order, line endings, and retained line text stay intact.

In-browser processingNo account requiredPrivacy details ↗

Remove Lines Longer Than N

Enter text and a maximum length.

A QUICK WALKTHROUGH

How to use this tool

  1. Paste text with one or more lines.
  2. Set the maximum length in Unicode code points.
  3. Remove longer lines, then copy or download the result.

Unicode code point length

Each line is measured with Array.from, so a supplementary character such as 😀 counts as one Unicode code point. Extended grapheme clusters can contain multiple code points and are not measured as a single displayed character.

Line ending preservation

LF, CRLF, and CR input is accepted. Retained lines keep their text, and output uses the first line-ending style found in the input. Empty and trailing lines are handled as lines.

Bounded local input

Input is limited to 100,000 UTF-16 code units and N to 1–10,000 code points. Processing happens in this browser; nothing is uploaded.

GOOD TO KNOW

Common questions

Does N count emoji as one character?

N counts Unicode code points. Most emoji count as one code point, while a displayed emoji sequence joined from several code points can count as several.

Are line endings changed?

The first detected LF, CRLF, or CR separator is used for the output, while retained line text and line order stay unchanged.