Add Line Numbers
Add line numbers to any text online. Choose the start number, step and format (1. 1) 001), pad with zeros or spaces and skip empty lines.
How to add line numbers
- Paste your text in the input box. Each line of the text gets its own number.
- Set Start at (1 by default; 0 and negative numbers work too) and the Step between two numbers, for example 10 to get 10, 20, 30.
- Choose a Format:
1.,1),1,1:,1 -,[1],#1or 1 + tab. Pick Custom… to write your own, using{n}where the number goes. - Choose a Padding if the numbers should line up, and a number of Digits (0 = automatic).
- Tick Skip empty lines if blank lines should stay unnumbered.
- The numbered text appears in the result box as you type. Add line numbers refreshes it; copy the result when you’re done.
Formats and custom templates
The format is a small template placed in front of each line. The presets cover the most common styles: numbered lists (1.), outlines (1)), references ([1]), tickets or issues (#1) and a tab after the number, which pastes neatly into two spreadsheet columns.
With Custom…, anything you type is kept literally and {n} is replaced by the number. A few examples:
| Custom format | Result |
|---|---|
Line {n}: |
Line 1: first line |
{n} → |
1 → first line |
Q{n}. |
Q1. first question |
<{n}> |
<1> first line |
If the format doesn’t contain {n}, the number is placed first and the text you typed follows it, so | gives 1 | text. You can also use {n} twice, for example to build labels.
Padding and alignment
Without padding, numbers grow from 1 to 10 and the text shifts by one character after line 9. Two padding styles keep everything aligned:
- Leading zeros (01, 02 … 10) gives numbers of equal width, like
001,002…120. This is handy for file names and for anything sorted alphabetically, because002sorts before010while2sorts after10. - Spaces, right-aligned puts spaces in front of short numbers, like the line numbers in a code editor.
With Digits (0 = automatic) set to 0, the width is that of the largest number in your text: 2 digits for 10 to 99 lines, 3 digits for 100 to 999. Enter a number to force a width, for example 3 to get 001 even for a short list. Negative numbers keep their sign in front: -01.
Empty lines
By default every line is numbered, blank ones included, which matches the line numbers of a code editor or a log file. With Skip empty lines, lines that are empty or contain only spaces receive no number and don’t advance the counter: a list with blank lines between paragraphs is numbered 1, 2, 3 without gaps. The original line breaks, including Windows line endings, are kept.
Frequently asked questions
Can I start numbering at 0 or count down?
Yes. Start at accepts 0 and negative numbers, and a negative Step counts down: start at 10 with step -1 to get 10, 9, 8…
How do I number only paragraphs?
Put a blank line between paragraphs and tick Skip empty lines. Each paragraph that fits on one line then gets its own number.
How do I get numbers like 001, 002, 003?
Choose Leading zeros (01, 02 … 10) as the padding and set Digits (0 = automatic) to 3, with the 1 format.
Can I remove line numbers afterwards?
This tool only adds numbers. To remove them, use a find and replace tool with a regular expression such as ^\d+\.\s that matches the number at the start of each line.
Is my text uploaded?
No. The numbering is done in your browser and nothing is sent or stored.
Related tools
- Sort Lines Sort lines of text alphabetically, numerically, by length or in natural order, reverse them or shuffle them randomly. Free and private, in your browser.
- Remove Duplicate Lines Remove duplicate lines from any list online. Keep the first occurrence in the original order, with options to ignore case, trim spaces and sort.
- Remove Line Breaks and Extra Spaces Remove line breaks and extra spaces from text copied from a PDF or an email. Keep paragraphs and lists, rejoin hyphenated words, strip quote marks.
- Text Repeater Repeat any text, word or emoji up to 10,000 times online, separated by new lines, spaces, commas or a custom separator, with optional numbering.