How to add line numbers to text

Line numbers make plain text easier to reference in reviews, instructions, transcripts, and examples. Each input line receives a sequential label.

Open the Text Line Numberer tool

Choose a useful numbering format

A simple format combines the number, a separator, and the original line. Common separators include a period, colon, tab, or vertical bar. Padding numbers with leading zeroes can keep long lists visually aligned.

Example starting at 7

7: alpha
8: beta
9: gamma

How to use a text line numberer

  1. Paste the text into the ToolPixels Text Line Numberer.
  2. Set the starting number.
  3. Choose the separator and any formatting options.
  4. Decide whether blank lines should receive numbers.
  5. Add the numbers, then copy or download the result.

The original content of each line remains in order. The generated numbers become part of the output text.

Blank lines affect references

Numbering every physical line gives stable references to the pasted layout, including empty lines. Skipping blank lines creates a compact list but means the displayed numbers no longer match positions in an editor that counts every line.

State the numbering rule when sharing references. For a transcript or poem, blank lines may be significant. For a list of records, they may simply be noise.

Line numbers are not source metadata

Adding text prefixes is different from an editor's line-number gutter. Pasted prefixes can break code, CSV, JSON, subtitles, and other structured formats. Use them in a copy intended for discussion, not in the file that a program will parse.

  • Keep an unnumbered original.
  • Choose a separator that does not resemble the content.
  • Use a starting number other than 1 when quoting an excerpt.
  • Reapply numbers after editing lines, because references can shift.

Common questions

Can numbering start at zero?

Use the configurable starting value supported by the tool. Zero can be helpful when matching zero-based indexes.

Can I remove the numbers later?

Yes with a suitable find-and-replace pattern or editor, but preserving an original is safer because separators may also occur in the content.

Add line numbers