Skip to contentSkip to the inputSkip to the result

Add line numbers

Number a text list from a chosen starting point.

Loading tool

Instructions

Add line numbers

How to use

  1. Paste text and set the first line number.
  2. Generate and copy the numbered result.

Supported input

  • Numbers each line, optionally skipping empty lines, or removes numbers already in sequence.

Input example

apple / pear; start 1; separator "1. "

Result example

1. apple / 2. pear

Troubleshooting

  • Check required inputs, numeric ranges and the selected conversion direction.

How it works

  • Number a text list from a chosen starting point.

Adding and removing line numbers without surprises

When numbered lines help

  • Reviewing a contract or minutes by email and pointing at “line 14” instead of quoting it.
  • Sharing a snippet of code or a log in chat so everyone can refer to the same line.
  • Numbering survey questions, quiz items or the lines of a script.
  • Continuing a sequence: the first batch ended at 100, so the next starts at 101.
  • Counting from 0, as array positions in most programming languages do.

What the separator changes

  • Tab (the default): pasted into a spreadsheet, the number and the text land in two columns, ready to sort or filter by number.
  • Full stop, “1. ”: an ordered-list marker in Markdown. Under CommonMark, one to nine digits followed by a full stop and a space start a list item, so the result renders as a numbered list.
  • Bracket, “1) ”: CommonMark accepts this as an ordered-list marker too, and in plain documents it reads well for sub-items.

Worked example: four lines with a gap

  1. 1The text is “first”, “second”, a blank line and “fourth”.
  2. 2With the defaults (start at 1, tab, number blank lines) the lines get 1 to 4, and the blank one becomes “3” followed by a tab. Numbers match the line positions exactly, which is what reviewers need when they cite a line.
  3. 3With Skip blank lines and the bracket separator you get “1) first”, “2) second”, the blank line untouched, then “3) fourth”: the right shape for questions or list items.

Zero-padding follows the last number

With padding on, numbers get leading zeros to the width of the last number, which is the start number plus the count of numbered lines minus one. Ten lines starting at 95 end at 104, so they run 095, 096 … 104.

Padding keeps the order wherever numbers are compared as text: file names, or cells sorted as text, put 10 before 2, but 02 before 10. Skipping blank lines also removes them from the count, so five lines with two blanks among them get just 1, 2 and 3, one digit wide.

How existing numbers are recognised

Remove leading numbers deletes the first number on each line and the full stop, closing bracket, colon, tab or space after it. Numbers in brackets such as (1), numbers with no space after the dot such as “1.apples”, and indented numbers are handled too; the indentation goes with them.

To avoid deleting real data, it acts only when the first numbers of all lines with text either go up by one (10, 11, 12 works) or are all the same, like the 1. 1. 1. common in Markdown. Gaps such as 1 then 3, a decimal such as “1.5 kg flour”, or a single line starting with a number above 1 make it stop with an error and change nothing.

Only the first number on a line is removed: in the three lines “1. apples”, “2. pears” and “3. 2026 plan”, the third becomes “2026 plan”. The same “3. 2026 plan” on its own is refused, since 3 is above 1.

Watch out for consecutive years

The check only asks whether the numbers count up. Two lines, “2025 review” and “2026 plan”, count up by one, so they are taken as numbered and come back as “review” and “plan”. With lists that start with years, student numbers or room numbers in sequence, compare the result with the original before you use it.

Checked

Frequently asked questions

Can I pad numbers as 01, 02?

Yes. Choose the padded option and zeros are added to match the last number's width: 01–12 for 12 lines, 001–100 for 100 lines. After the number you can use a tab, '1. ' or '1) '.

Can blank lines be skipped?

Yes. Set blank lines to Skip them; they stay in place without a number and the numbering continues on the next line with text. By default blank lines are numbered too.

Anything to watch when removing existing numbers?

Remove leading numbers only runs when every line with text starts with numbers that count up, 1, 2, 3 (or are all the same); it then deletes each number and a following dot, bracket, colon, tab or space. A single line '2026 plan' is left alone with a message that the lines are not numbered in sequence. But '2025 review' followed by '2026 plan' counts up by one, so both are taken as numbered and come back as 'review' and 'plan'. Check the result.