Add Line Numbers to Text
Prefix every line with a sequential line number — perfect for code samples and references.
Prefix every line of text with a line number. Free online line numbering tool.
Add Line Numbers to Text examples
| Input | Output |
|---|
| first item
second item
third item | 1. first item
2. second item
3. third item |
How the add line numbers to text works
- Each line receives a sequential number and a separator.
- Blank lines are numbered too, so counts match the original.
- Copy the numbered block straight into docs or tickets.
Rules and edge cases
- Every line gets a sequential number followed by a separator, starting at 1.
- Blank lines are numbered as well, so the numbering matches the original line positions in an editor.
- The original text on each line is left exactly as written, including indentation.
Frequently asked questions
Do the numbers stay when I paste into a code editor?
Yes — they become part of the text. Use numbered output for reviews, quotes and tickets, not for code you intend to run.
Can I start numbering at a different value?
Numbering starts at 1. To reference a section of a larger file, note the offset in your comment or paste from the first line you need.