Put line numbers on a text — or take them off

Number lines before pasting into a ticket or doc, or strip existing prefixes from copied output.

Tools used in this guide

The job

Two opposite chores share one tool. Adding numbers helps when someone will refer to "line 12" in a review or when a list must read as ordered. Removing them matters when you copy output that already has numbers — like `nl` output or a pasted code listing — and want the plain text back.

How to do it

Pick "add" or "remove" at the top, paste the text, and apply. When adding, choose the separator style (`1.` / `1:` / `1)` / space / tab), the starting number, whether to zero-pad, and whether blank lines get a number too.

  • Zero padding keeps columns aligned: 01, 02 … 10 instead of 1, 2 … 10.
  • Skipping blank lines keeps numbering on content lines only.
  • Start at something other than 1 to continue a list across two pastes.

Worked example

A requirements list of 15 items pasted as `01. …`, `02. …` reads cleanly in a ticket and survives clients that strip Markdown list markup. Going the other way, `nl`-style output ` 7 some text` loses its numbers and returns the raw lines.

Limits

Removal is conservative: it strips a number ending in . : ) or a tab, or one indented like `nl` output — so "2024 report" and lines holding just a bare number are left alone. Adding never rewrites existing numbers; if the text is already numbered, remove first and re-add.