Add line numbers to text
Numbers every line, in the format you choose — and removes numbering too.
Paste text and press the button. The format field controls exactly how each number looks: whatever you
type is used as the template, and the digit 1 inside it is replaced by the running number. So
1. gives 1. , (1) gives (1), and Step 1: gives
Step 1: .
Formats people use
1.— plain numbered list, the default.1)— legal and academic style.[1]— references and citations.1 |— a code listing you are pasting into a document.Step 1:— instructions.Q1.— question lists.
Zero padding lines them up. Without it, line 9 and line 10 start in different columns and the text looks
ragged; with it you get 09 and 10. The width is calculated from the largest number, so a
120-line document pads to three digits and a 12-line one to two.
Start and step cover the cases that catch people out. Continuing a list that already reached 47? Start at 48. Numbering every other line, or matching an external system that counts in tens? Set the step.
Skip empty lines is on by default. A blank line between paragraphs is not an item, and numbering it throws the count off and leaves a stray number floating in the whitespace.
Removing numbering — the other half of the job
Just as often, the problem is the reverse: you copied a numbered list out of a PDF, a forum post or a code viewer
and now every line starts with a number you do not want. Press "Remove numbering" and it strips the leading counter
whatever form it took — 1., 1), (1), [1], 1:,
1 -, plain 1 , and lettered or Roman variants like a) and iv..
It only removes a marker at the start of a line, so a date or a price in the middle of your text is safe. Numbers
that start a line but are followed directly by a letter — like 2024 was a good year — are left alone,
because those are content rather than numbering.
A note on copying the result
Numbers added this way are real text, unlike the numbers your editor shows in its gutter. That is the whole point — they survive copying, pasting and emailing. It also means they are yours to maintain: if you insert a line afterwards, renumber by removing the numbering and adding it again rather than editing by hand.
Doing it without this tool
Notepad++: Edit → Column Editor (Alt+C) has a "Number to insert" option with an initial value, increment and leading-zeros checkbox. It is genuinely good, and it only inserts at the cursor column, so you need the cursor at the start of the first line and no line shorter than that column.
Excel: =ROW()&". "&A1 filled down.
Word: the numbered-list button, which produces list formatting rather than text — copy it elsewhere and the numbers may vanish or restart.
Command line: nl file.txt or cat -n file.txt. To remove numbering,
sed 's/^[0-9]*[.)]\s*//' file.txt.
Runs entirely in your browser. Your text is never uploaded — open DevTools, Network tab, and you will see zero requests while you use this tool.
How to use it
- Paste your text into the box.
- Set the format — type 1. or 1) or [1] and the 1 is replaced by the running number.
- Adjust the starting number and step if you are continuing an existing list.
- Press "Add numbers". To strip numbering from pasted text instead, press "Remove numbering".
Related tools
Frequently asked questions
Yes, set the "Start at" field. This is how you continue a list that already ended at 47 without renumbering the earlier part.
Tick "Pad with zeros". The width is taken from the largest number in your text, so a hundred lines pad to three digits and ten lines pad to two.
Not by default, since a blank line between paragraphs is not a list item. Untick "Skip empty lines" if you need every line numbered regardless.
Yes. "Remove numbering" strips a leading counter in any common form — 1. 1) (1) [1] 1: 1 - as well as lettered and Roman markers — and only at the start of a line, so numbers inside your text are untouched.
Real text. They are part of the content, so they survive copying and pasting, unlike the line numbers an editor draws in its margin.