Add line numbers to text — any start, step and style

Paste text and every line gets a number in front of it, starting where you want, counting in the steps you want, in the style you choose.

Live demo · real result from this tool

Result

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

Processed on your device — nothing is uploaded.

How to use Add Line Numbers

  1. Paste your text into Your text.
  2. Set Start at and Step. The defaults, 1 and 1, give 1, 2, 3 and so on.
  3. Pick what comes After the number: “1. “, “1) “, “1: “, “1 | “, Tab or Space.
  4. Tick Pad with zeros (01, 02 …) for numbers of equal width.
  5. Tick Do not number empty lines if blank lines should stay blank.
  6. Copy the numbered text.

What it does and when to use it

Numbers make lines easy to refer to. “See line 14” is clearer than “the line about the delivery date”. Add numbers when you:

  • share a poem, script, contract clause list or transcript and want comments to point at exact lines;
  • quote code in an email or forum post that does not show line numbers;
  • turn a plain list into a numbered list for a document;
  • prepare test cases, questions or tasks that need IDs.

The separator choice matters for where the text goes next. “1. “ looks like a normal numbered list. Tab is best for pasting into a spreadsheet, because the number and the text land in two columns. “1 | “ reads well in plain-text tables.

For lists marked with letters (a. b. c.) or Roman numerals (i. ii. iii.), try Text to Numbered List. To put the same text at the start of every line instead of a number, use Add Prefix/Suffix. Clean the input first with Remove Empty Lines if the blank lines are not wanted at all.

How it works

The text is split into lines. A counter starts at your Start at value and goes up by Step each time a line is numbered. Each line becomes number + separator + the original line. With “Do not number empty lines” ticked, a blank line is passed through unchanged and the counter does not move.

For padding, the tool works out the last number the list will reach (counting only non-empty lines when empty lines are skipped) and counts its digits. Every number is then padded with leading zeros to that width. The numbering happens in your browser.

Worked examples

Default style. The four lines “alpha”, “beta”, an empty line and “gamma” become 1. alpha, 2. beta, 3. and 4. gamma. The empty line still gets its number.

Skip empty lines. The same text with “1) “ and “Do not number empty lines” ticked gives 1) alpha, 2) beta, an empty line, then 3) gamma.

Zero padding. Twelve lines with “1: “ and padding on are numbered 01: to 12:, so the ninth and tenth lines read 09: i and 10: j, lined up.

Tens and tabs. Three lines with Start at 10, Step 10 and Tab give 10, 20 and 30, each followed by a tab. Pasted into a spreadsheet, the numbers fill column A.

Limits and tips

  • Numbers are always whole numbers; letters and Roman numerals are not available here.

Frequently asked questions

Can I start from a number other than 1?
Yes. Type any whole number into Start at, including 0. Step sets how much each number goes up by, from 1 upwards, so Start at 10 with Step 10 gives 10, 20, 30.
How does zero padding decide the width?
It looks at the biggest number the list will reach and pads every number to that many digits. With 12 lines, numbers run 01 to 12; with 150 lines, 001 to 150. This keeps the text after the numbers in a straight column.
What happens to empty lines?
By default they get a number like any other line. Tick "Do not number empty lines" to leave them blank and keep counting on the next line with text. Lines that hold only spaces count as empty.
How do I remove the numbers again?
Use Remove Line Numbers. It recognises the "1. ", "1) ", "1: " and tab styles. For the "1 | " style it currently removes the number but leaves the bar, so choose another style if you plan to strip numbers later.

Written by the ToolsRift team · Last updated

Pages are drafted with AI assistance and checked by automated tests. How we write and check pages.

Was this tool useful?

Report a problem

Start typing to search every tool.

↑ ↓ to moveEnter to openEsc to close