OnlineNotes Logo

Add Line Numbers

Number every line of a list, a script or a log. Pick the start number and the format, then copy the numbered text anywhere.

Options

About this tool

Line numbers make text easy to refer to. "See line 14" works in a code review, a legal draft, a script read-through or a support ticket, and only if everyone sees the same numbers. Typed numbers stay put when the text is pasted into an email or a chat, where an editor's line numbers would not.

Pick the tab format to paste into a spreadsheet: the numbers land in one column and the text in the next. Zero padding keeps numbers aligned and makes them sort correctly as text, so line 10 does not sort before line 2.

How it works

  1. Paste your text into the input box.
  2. Set the start number. It can be any whole number, for example to continue from an earlier page.
  3. Pick a format, and choose whether blank lines get a number.
  4. Copy the numbered text from the output box.

Worked example

Input

Intro

Main point
Summary

Output

1. Intro

2. Main point
3. Summary

With "Skip blank lines" on, the blank line keeps its place without taking a number. Turn it off to count every line, as a code editor does.

Edge cases and limits

  • The numbers are plain text. They will not update when you edit the text, so paste the new version back in to renumber.
  • A long line that wraps on screen still counts as one line.
  • To remove numbers that are already there, use find and replace in regex mode with ^\d+\.\s and an empty replacement.

Frequently asked questions

How do I add line numbers in Notepad?

Windows Notepad shows the line and column of the cursor but cannot add numbers to the text. Paste the text here, then copy the numbered version back.

Can I start from a number other than 1?

Yes. Type any whole number in "Start at". This is useful when you continue from an earlier section.

Can I remove the numbers afterwards?

Yes. Keep your original text, or use the find and replace tool with a regular expression.

Related tools