🔢 Line Number Adder

Paste text to add sequential line numbers, with control over the starting number, zero-padding and separator.

How each prefix is built

The text is split on newline characters and every line gets a number based on its position in that list, not on whether it has any content:

number = start + index          (index counts from 0)
prefix = String(number).padStart(padWidth, "0")
output = prefix + separator + line

With the defaults - start 1, pad width 1, separator ". " - four lines come back as 1. First line through 4. Fourth line. Set the pad width to 3 and the same lines become 001. to 004. , which is what keeps a numbered list aligned once it passes line 9 or line 99.

Setting start, padding and separator

Blank lines are numbered like any other. If your text ends with a newline you will see one extra number on an empty last line - delete the trailing newline in the input to avoid it.

Frequently asked questions

How do I add line numbers to text without Word or Excel?

Paste the text into the box above. Numbering happens as you type and the result appears in a read-only box with a copy button, so nothing is uploaded and no spreadsheet formula is needed.

Can I skip blank lines when numbering?

Not in this tool - every line in the input gets a number so the count matches the original file. Run the text through the Remove Blank Lines tool first if you want empty lines dropped before numbering.

Why do my numbers start with zeros?

The zero-pad width is above 1. A width of 3 pads every number to three characters, so 7 prints as 007. Set the width back to 1 for plain numbers.