Boneyard Tools

Add Line Numbers to Text

Add Line Numbers puts an incrementing number in front of every line of the text you paste. Set where the count starts, how far each number steps, and which separator sits between the number and the line, then pad the numbers so a long list stays aligned. Blank lines can be numbered along with the rest or left untouched while the count continues.

How to add line numbers

  1. Paste or type your text into the 'Your text' box, or click 'Load sample' to try it.
  2. Set 'Start at' to the first number you want and 'Step' to how much each line increases.
  3. Pick a 'Separator' style, from '1. text' and '1: text' to '1) text', '1 - text', a tab, or a plain space.
  4. Turn on 'Pad numbers to align' to give every number the same width, and 'Skip blank lines' to leave empty lines unnumbered.
  5. Read the result under 'Numbered text', then use Copy or Download to save it as numbered.txt.

Examples

Number every line, including the blank one (default settings)

First line
Second line

Fourth line
1. First line
2. Second line
3. 
4. Fourth line

Keep the count going but leave blanks empty (Skip blank lines on)

First line
Second line

Fourth line
1. First line
2. Second line

3. Fourth line

Start at 8 and pad so widths match (Pad numbers to align on)

alpha
beta
gamma
delta
08. alpha
09. beta
10. gamma
11. delta

Frequently asked questions

Can I start counting from a number other than 1?

Yes. Set 'Start at' to any value, including 0 or a larger figure like 100, and the numbers count up from there. This is handy for continuing a list where another block left off.

What does the Step control do?

Step is how much each line number increases. Leave it at 1 for a plain sequence, or set 2, 5, or 10 to count by twos, fives, or tens. The step is applied only to lines that actually receive a number.

Which separator styles are available?

Six options sit in the Separator menu: a period and space (1. text), a colon (1: text), a closing parenthesis (1) text), a spaced hyphen (1 - text), a tab, and a single space (1 text). The separator is placed between the number and the original line.

How does the padding option work?

Padding makes every number the same width by measuring the widest number in the set and left-filling the shorter ones. With a visible separator it pads with zeros, so 8 through 11 become 08, 09, 10, 11. With the plain space separator it pads with spaces instead of zeros.

What happens to blank lines?

By default a blank line still receives a number, so an empty line becomes something like '3. ' with nothing after the separator. Turn on 'Skip blank lines' and empty lines stay empty while the numbering continues unbroken on the lines that hold text.

Does it keep my Windows or Mac line endings?

Yes. The tool splits on CRLF, lone CR, and LF and writes each original break back out, so numbered text that started on Windows, classic Mac, or Unix keeps its exact line endings.

Why is the last empty line not numbered?

A newline at the very end of your text leaves a trailing empty segment that is not really a line, so it is skipped and never numbered. Real blank lines in the middle of the text are still handled by the Skip blank lines option.

Can I download the numbered text?

Yes. Alongside Copy there is a Download button that saves the output as a plain text file named numbered.txt, which is useful for long documents you do not want to paste by hand.

Is my text private?

Yes. All numbering happens in your browser with JavaScript, and nothing you paste is uploaded to a server, so private notes and code stay on your device.

Learn more

Related tools