Free · No sign-up · Runs in your browser

Add Line Numbers to Text

Add a sequential number to the start of every line. Choose where the numbering starts, which separator to use, and whether to pad numbers with leading zeros so they align.

0 chars0 lines

The options

  • Start at — begin at any number. Use 0 for zero-indexed output, or continue from where a previous batch ended.
  • Separator — choose 1., 1), 1:, or just a space, to match the convention you need.
  • Pad with zeros — turns 1, 2, … 10 into 01, 02, … 10 so the numbers align in a monospaced font and sort correctly as text.
  • Skip blank lines — leaves empty lines unnumbered, so the count reflects real content.

Why zero padding matters for sorting

Numbered items sorted as text put "10" before "2", because sorting compares characters rather than values. Padding with leading zeros fixes this permanently: "02" reliably precedes "10" under any alphabetical sort, in any tool. This is exactly why file naming conventions favour 01-intro over 1-intro, and it is worth doing any time your numbered output will later be sorted, imported, or used as filenames.

Typical uses

Referencing specific lines when reviewing a document or a log file with someone. Turning a plain list into a numbered one for a document that does not auto-number. Creating sequential IDs or reference codes for a spreadsheet import. And preparing quiz or survey questions where each item needs a stable number.


Frequently asked questions