Text tool

Keep N Characters Each Line

Process each line independently in your browser and retain its first N code points.

In-browser processingNo account requiredPrivacy details ↗

Maximum 100,000 UTF-16 characters. Processing stays in this browser.

A QUICK WALKTHROUGH

How to use this tool

  1. Enter text and a whole-number limit.
  2. Apply the limit independently to every line.
  3. Review and copy the result.

Per-line Unicode behavior

Each line is processed independently using Unicode code points from Array.from. Extended grapheme clusters may contain multiple code points and are not promised to remain together. LF, CRLF, and CR are accepted; the first detected separator style is used, and blank and trailing lines remain present.

GOOD TO KNOW

Common questions

Are grapheme clusters counted?

No. The limit counts Unicode code points, so a displayed grapheme can use more than one count.

Are line endings preserved?

Yes. Lines, blank lines, the trailing empty line, and the first detected LF, CRLF, or CR separator style are preserved.