Toolbox Hub
All Tools

Line Number Adder

Add line numbers

Add line numbers Runs locally in your browser

Each line gets a number placed in front of it.

About the

The Line Number Adder puts a number in front of every line of a block of text, which is what you want when you need to refer to a specific line in a review, a paste or a screenshot. It numbers from one and keeps the original lines untouched, so the result can be pasted into a ticket or a chat message and read back line by line. Removing the numbers afterwards takes one pass with a text editor.

Where people use the

  • Numbering a code snippet so someone can point at a specific line.
  • Preparing a log excerpt for a bug report.
  • Making a long list easier to discuss line by line.
  • Adding references to a pasted configuration before a review.

How to use the

  1. 1

    Paste the text

    Any block of text or code, one item per line.

  2. 2

    Run it

    Each line gets a number and a full stop placed in front of it, starting at one.

  3. 3

    Copy the result

    Paste it wherever people need to reference lines by number.

  4. 4

    Strip the numbers when you are done

    Removing the prefix is a single find-and-replace on the numbering pattern.

Tips and best practices

  • Every line is numbered, blank ones included, so the numbers match the original.
  • Strip the prefix with a find-and-replace when you need the clean text back.
  • Columns shift after line nine because the numbers are not padded.

Frequently asked questions

Does it start at one?

Yes, and every line is numbered, including blank ones, so the numbering matches what you see.

Can I start at a different number?

No. Numbering always starts at one. If you need an offset, add it yourself afterwards.

Is the numbering padded or aligned?

Not padded. Each line gets its number followed by a full stop and a space, so columns shift once you pass nine lines.

Can it remove line numbers too?

Not with this tool. It only adds them.

Does it change the content of the lines?

No. Only a prefix is added; the rest of each line is left exactly as it was.

Related Tools