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

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.

Try:
0Words
0Characters
0No spaces
0Sentences
0Paragraphs
0Lines
0Pages
0Reading
0Speaking

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

  1. Paste your text into the box.
  2. Set the format — type 1. or 1) or [1] and the 1 is replaced by the running number.
  3. Adjust the starting number and step if you are continuing an existing list.
  4. Press "Add numbers". To strip numbering from pasted text instead, press "Remove numbering".

Related tools

Cut charactersCuts a fixed number of characters from the start or end of every line.Split into chunksBreaks long text into equal parts by characters, words or lines.Truncate textShortens each line to a maximum length, optionally without cutting a word.Compare two listsFinds what is only in list A, only in B, in both, or different between them.What is a URL slugThree to five words, lowercase, hyphens, no dates. And why changing it later…Magic 8 ballAsk a yes or no question. The ball answers.Group generatorPaste names, choose how many groups, get evenly sized random teams.

See all text tools →

Frequently asked questions

Can I start numbering from a number other than 1?

Yes, set the "Start at" field. This is how you continue a list that already ended at 47 without renumbering the earlier part.

How do I get 01, 02 instead of 1, 2?

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.

Does it number blank lines?

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.

Can it remove numbers that are already there?

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.

Are the numbers real text or just displayed?

Real text. They are part of the content, so they survive copying and pasting, unlike the line numbers an editor draws in its margin.