Add line numbers
Number each line of a text with the start, separator and padding you choose, or strip existing numbers in one click. Free, and your text stays in your browser.
How to use it
- Paste your text in Your text.
- Keep Add line numbers in Action, set Start at and pick the style in After the number.
- Tick Pad with leading zeros (01, 02...) or Skip empty lines (do not number them) if you need them.
- To undo numbering, choose Remove line numbers in Action. Then copy the result.
Numbering lines of text: options, formats and pitfalls
When line numbers help
Numbered lines make text easier to discuss and to check. Lawyers cite "line 14", editors mark corrections by line, teachers hand out poems and code listings with numbers, and developers paste log excerpts into a ticket so a colleague can point at one exact row. Typing the numbers by hand is slow and breaks as soon as a line is added. This tool numbers every line in one step, and it can also strip numbers that already exist, which is useful when text was copied from a numbered listing.
The options
| Option | What it does |
|---|---|
| Action | Add line numbers, or remove them |
| Start at | First number to use, from 0 to 999999; handy to continue a numbering from a previous page |
| After the number | What goes between the number and the text: a dot, a parenthesis, a colon, " - ", " | ", a tab or a single space |
| Pad with leading zeros | Gives every number the width of the largest one, so 8 to 11 becomes 08, 09, 10, 11 |
| Skip empty lines | Leaves blank lines blank and does not spend a number on them (on by default) |
Worked examples
- Paste four lines: Alpha, Beta, an empty line, Gamma. With the defaults (start 1, dot, skip empty lines on) the result is
1. Alpha,2. Beta, the blank line unchanged, and3. Gamma. The summary reads 3 lines numbered out of 4 in total. - Use the same text with Start at 8, After the number set to the parenthesis style, zero padding on and Skip empty lines (do not number them) off. The result is
08) Alpha,09) Beta,10)and11) Gamma. Four lines are numbered, and the padding is two digits because the largest number is 11. - To undo it, paste
1. Alpha,02) Beta,3: Gammaand2024 reportand choose Remove line numbers. You get Alpha, Beta, Gamma and report, and the summary counts 4 numbers removed. Notice that "2024 report" lost its "2024": see the tips below.
What removal recognizes
Removal looks only at the start of each line. It accepts optional leading spaces or tabs, then digits, then one of these separators: a dot, a closing parenthesis, a colon, a hyphen, a tab or spaces, plus any spaces that follow. Numbers elsewhere in a line, and lines without a number at the start, are left as they are. Format, line breaks and trailing empty lines are preserved.
Tips and common mistakes
- Real numbers at the start of a line. A line such as "2024 report" or "100 items sold" looks like a numbered line to the remover. Review the output before using it, especially for lists of figures.
- Tabs versus spaces. Choose the tab separator when you will paste the result into a spreadsheet, so the numbers go into their own column.
- Blank lines. If your text has paragraph breaks and you want a continuous count, turn off skipping empty lines. If you want to number only content lines, leave it on.
- Different line endings. Text from Windows, Mac or Linux is handled the same way, and the result uses standard line breaks.
- Start at 0. Programmers sometimes want zero-based numbering; set Start at to 0.
Related tools
Before numbering, you may want to tidy the text with the duplicate line remover or put the lines in order with the line sorter. After numbering, check the length of your text with the word and character counter.
Questions
Are empty lines numbered?
Only if you untick Skip empty lines. By default blank lines stay blank and do not use up a number.
How does zero padding work?
All numbers get the same width as the largest one, so 1 to 12 becomes 01 to 12 and 1 to 100 becomes 001 to 100.
What does Remove line numbers delete?
A number at the start of each line plus the separator after it, such as "12. ", "03) " or "4: ". Numbers elsewhere in the line are not touched.
Could removal cut a real number from my text?
Yes, if a line truly starts with a number followed by a space, such as "2024 report". Check the result before using it.