Add Line Numbers to Text

Prefix every line with a sequential line number — perfect for code samples and references.

Prefix every line of text with a line number. Free online line numbering tool.

Add Line Numbers to Text examples

InputOutput
first item second item third item1. first item 2. second item 3. third item

How the add line numbers to text works

  1. Each line receives a sequential number and a separator.
  2. Blank lines are numbered too, so counts match the original.
  3. Copy the numbered block straight into docs or tickets.

Rules and edge cases

  • Every line gets a sequential number followed by a separator, starting at 1.
  • Blank lines are numbered as well, so the numbering matches the original line positions in an editor.
  • The original text on each line is left exactly as written, including indentation.

Frequently asked questions

Do the numbers stay when I paste into a code editor?

Yes — they become part of the text. Use numbered output for reviews, quotes and tickets, not for code you intend to run.

Can I start numbering at a different value?

Numbering starts at 1. To reference a section of a larger file, note the offset in your comment or paste from the first line you need.