Add Line Numbers

Prefix each line with a number, choosing the starting value, padding and separator.

Processed on your device — no upload

termiva number-lines --start 1
0 chars · 0 words
0 chars · 0 words
in 0 wordsout 0 wordsnothing uploaded

How to add line numbers

  1. Paste the text you want numbered.
  2. Choose the starting number, separator and whether to pad.
  3. Copy the numbered result.

How it works

Each line gets a counter prefixed to it. The interesting choices are what happens to blank lines and how the numbers align.

Blank lines are left unnumbered by default, and the counter does not advance past them. That keeps the numbering continuous across paragraph breaks — if you number every blank line too, a document with paragraph spacing ends up with numbers that skip in a way nobody wants to cite.

Zero-padding matters as soon as your text crosses ten lines. Without it the numbers are ragged: 9. is narrower than 10., so the text after them does not line up. The pad width is computed from the highest number the text will actually reach, so a 90-line document pads to two digits and a 900-line one to three — no wasted leading zeros.

The separator is worth thinking about. 1. reads as a list. 1: reads as a reference. A tab keeps the numbers in a separate column when pasted into a spreadsheet.

A worked example

You are sending a draft clause list to a colleague and want to be able to say “line 14 needs rewording” without ambiguity.

Paste the 23 clauses. With the defaults — start at 1, . separator, no padding, blank lines skipped — you get a clean numbered list where every clause has a stable reference.

Now turn zero-padded on. Numbers 1 through 9 become 01 through 09, and suddenly every clause body starts at the same column. On a list that crosses ten items this is the difference between a tidy document and a ragged one, and it is the setting most people forget exists.

A different use. You are quoting lines 340–352 of a log file in a bug report. Paste just that excerpt and set start at to 340 — the numbering now matches the original file, so anyone reading your report can find the same lines.

Finally the tab separator. Choose it, copy the result, and paste into a spreadsheet: the numbers land in column A and the text in column B, because the tab is what a spreadsheet reads as a cell boundary.

If your text has blank lines scattered through it from a paste, clean it first so the numbering reflects the real structure.

Questions

How do I enumerate lines in a list?

Numbers are added in front of each line, padded so they line up. Handy for referring to a specific line by index in a message or a bug report.

Are blank lines numbered?

Not by default, and the counter does not advance past them — so numbering stays continuous across paragraph breaks. Switch the option if you want every line counted.

What does zero padding do?

It pads numbers to the same width, turning 1 into 01 when the text reaches double figures. The result is that all the text after the numbers lines up in a column.

Can I start from a number other than 1?

Yes. Set the start value to match an excerpt's position in a larger file, so your line numbers correspond to the original.

Is my text uploaded?

No. The numbering runs in your browser and this site has no backend.

How wide is the padding?

Calculated from the highest number the text will reach, so a 90-line text pads to two digits and a 900-line one to three. No unnecessary leading zeros.

Which separator should I use?

A full stop reads as a list, a colon as a reference, and a tab keeps the numbers in their own column when pasted into a spreadsheet.

Can I remove line numbers with this tool?

No — use find and replace with a regular expression such as ^\d+\.\s* to strip an existing numbering.

Does it work with code?

Yes, though numbered code can no longer be run or compiled without stripping the numbers again. It is for quoting and reviewing rather than for editing.