Skip to content
ToolsUnlocked

Add Line Numbers

Add line numbers to any text, list, code or script. Choose a format such as 1. or [1], pick the starting number and the step, skip empty lines if you want, and right-align numbers so long lists line up neatly. Copy the numbered text or download it.

Runs in your browser Free, no sign-up
Add Line Numbers

How to add line numbers

  1. 1 Paste your text into the Your text box.
  2. 2 Choose the number format, the start number and the step.
  3. 3 Tick Skip empty lines or Right-align numbers if needed.
  4. 4 Copy or download the numbered text.

Where numbered lines help

  • Code review and support: "line 42" is clearer than "the bit near the bottom".
  • Scripts and transcripts: actors, editors and translators can refer to exact lines.
  • Legal and academic text: many contracts and exam passages are numbered so comments can point to a line.
  • Lists: turn a pasted list into a numbered one for a document or a message.

Skipping empty lines keeps the numbers continuous in text with gaps. For a clean list first, use Remove Duplicate Lines and Sort Lines Alphabetically.

Features

Six formats

1. 1) 1: tab, 001 and [1].

Custom start and step

Start at any number and count by 1, 2, 10 or more.

Skip empty lines

Blank lines stay unnumbered.

Aligned numbers

Right-align or zero-pad for neat columns.

When to use it

Code reviews

Share code with line numbers for comments. Sort first with Sort Lines Alphabetically.

Legal and scripts

Number lines of contracts, transcripts or screenplays. Remove Duplicate Lines before numbering.

Lists

Turn a plain list into a numbered list. Compare two numbered versions with the Diff Checker.

Teaching

Number lines of a poem or passage for discussion. Make many copies of a line with the Text Repeater.

Related Text tasks

Frequently asked questions

How do I start numbering from 0?

Set Start at to 0.

Can I count by tens?

Yes. Set Count by to 10 to number lines 10, 20, 30 and so on.

What does 001 format do?

It pads numbers with zeros so they all have the same width, such as 001, 002 up to 120.

Can I remove line numbers later?

Use Find and Replace with a regular expression such as ^\d+\. to remove them.

Will it number wrapped lines separately?

No. Numbers follow the real line breaks in your text, not the way long lines wrap on screen.

Can I put the number after the text instead of before?

No. Numbers are always added at the start of each line, which is what code reviews, scripts and legal documents expect.

Can I number only some lines?

Turn on skip empty lines to number only lines with text. To number a part of a document, paste just that part.

How do I number lines for a screenplay or transcript?

Paste the script, choose a format such as 1. or [1] and keep the step at 1. Skip empty lines so the numbers follow the spoken lines.

What is the 001 format for?

It pads numbers with zeros to the same width, such as 001, 002 and 010, so the list lines up and sorts correctly in files and spreadsheets.

Can I number lines with a tab after the number?

Yes. Choose the tab format and the text after each number lines up neatly when you paste it into a spreadsheet or a code editor.

How do right-aligned numbers help?

With more than nine lines, right-aligned numbers keep the text in a straight column, so line 9 and line 10 start at the same place.

How this tool works. These text tools run entirely in your browser with plain JavaScript, so the text you paste never leaves your device and results update as you type. Each tool is tested with real text such as copied PDFs, emails, code, lists, emojis and non-English scripts before it goes live.

HF

Built and reviewed by , founder and lead developer
Last updated · How we check our tools · Report a problem