🔢 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
- Start at shifts the whole sequence. Use 0 for an array-style index, or 47 when you are pasting an extract that began on line 47 of a bigger file. The field falls back to 1 if you clear it.
- Zero-pad width is clamped to 1-10. It is a minimum, not a
truncation: with a width of 2, line 100 still prints as
100. - Separator is copied verbatim, so it can be
") ", a tab," | "for pasting into a spreadsheet, or nothing at all.
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.