The Add Line Numbers tool prefixes every line of your text with a running sequential number. It is useful for creating numbered lists, referencing lines in code reviews or documentation, preparing legal or transcript line references, and turning a plain list into an ordered one — all without a spreadsheet or text editor macro.
How it works
The tool splits your input on newlines and walks through it line by line, attaching a counter that increments with each numbered line. You control four options:
- Start at — the first number, which can be 0, 1, or any positive or negative integer.
- Separator — the characters placed between the number and the line text (e.g. ”. ”, ”: ”, ” | ”).
- Zero padding — pads every number to the same width, calculated from the largest number that will actually be emitted so they align in a column.
- Skip blank lines — leaves empty lines unnumbered while preserving their position.
Example
Numbering three lines starting at 1 with the ”. ” separator turns:
first line
second line
third line
into:
1. first line
2. second line
3. third line
With zero padding enabled on a 150-line document, line 7 renders as 007. ... and line 100 as 100. ... so every number aligns in a column and the file looks tidy in a monospace editor.
When each option matters most
Start at 0 is useful for programmers who work in zero-indexed systems — a list of array elements, for example, reads naturally as 0, 1, 2, 3.
Starting at a number other than 1 is handy when you are numbering a continuation of a document that already has lines 1–50 and you need the next section to start at 51.
Zero padding matters most when you paste the output into a tool that sorts lexicographically rather than numerically. Without padding, line 10 sorts before line 2. With zero padding, 010 sorts correctly after 009.
Skip blank lines is the right choice when your text has paragraph breaks you want to preserve visually, but you only want to number the content lines — as in a legal transcript or screenplay where blank lines separate beats or speakers.
Common use cases
- Code review: number every line in a snippet before pasting it into a comment, so reviewers can reference
line 14unambiguously. - Legal documents: court transcripts and legal exhibit lists often require numbered lines. Start at 1, use the pipe or colon separator, and turn on zero padding for a professional format.
- Data preparation: turn a plain-text list into a numbered one for import into a spreadsheet or CMS.
- Diff comparison: number both files before diffing them line by line to keep track of what shifted.
| Option | Effect |
|---|---|
| Start at 1 | First line numbered 1 |
| Separator ”. “ | Output “1. text” |
| Zero padding on | ”001”, “002”, … aligned |
| Skip blank lines | Empty lines left unnumbered |
Everything runs in your browser — nothing is uploaded.