Add line numbers
Paste a list, a poem, a script or a piece of code and get each line numbered. Choose where the count starts, what follows the number, and whether blank lines are numbered.
Runs in your browser: nothing you enter is sent anywhere.
How to use it
- Paste the text. Every line gets a number on the right at once.
- Choose the first number and what comes after it: a dot, a bracket, a colon, a dash, a tab or a space.
- Turn blank-line skipping on if you want empty lines left alone, then press Copy.
How it works
The text is split into lines (Windows, old Mac and Unix line breaks all work). A counter starts at the chosen number and goes up by one for each numbered line. The number, the separator and the original line are joined together. With alignment on, numbers are padded on the left to the width of the largest one.
Worked example
The three lines “apple”, “banana”, “cherry” with the defaults become “1. apple”, “2. banana” and “3. cherry”. Starting at 10 with a bracket gives “10) apple”, “11) banana”, “12) cherry”.
Tips
A tab after the number pastes cleanly into spreadsheets, putting the number in its own column. To remove numbers later, use find and replace with a pattern such as ^\d+[.)] to match them.
Frequently asked questions
What happens to blank lines?
By default they are numbered like any other line. With "Do not number blank lines" they stay empty and do not use up a number, so the next line with text continues the count.
What does "Align the numbers" do?
It adds spaces before shorter numbers so that the text starts in the same column, for example " 9." and "10." in a list of ten lines or more. The output uses a monospace font so you can see it.
Does a final line break get a number?
No. If your text ends with a line break, the empty last line stays empty, because it is not a line of text.
How do I number from a different value, such as 5?
The start can be 0, 1, 10 or 100. For another value, number from 1 and then adjust with a spreadsheet, or number the text in parts.