Add Line Numbers

Number every line of a text, list or code snippet in one click. Choose the starting number and step, pick a format such as "1.", "1)", "[1]" or "#1", pad numbers with zeros so they line up, skip blank lines, or strip existing line numbers from copied text.

  • 100% free
  • No sign-up
  • Private & local
  • Works on mobile
Drop a text or code fileor browse files · or paste below

Private by design: every calculation runs locally in your browser. Nothing you type is sent to a server or stored by us.

What Is a Line Number Tool?

A line number tool adds a number to the start of each line of text. Numbered lines make it easy to reference specific parts of a document ("see line 42"), discuss code in reviews and tutorials, prepare legal and academic texts for citation, create numbered lists and scripts, label steps in instructions, and keep track of rows when importing data. Numbering hundreds of lines by hand is tedious, and word processors often renumber lists unpredictably, so a dedicated tool is faster and more reliable.

This free tool gives you full control: start from any number, count in steps of 1, 5, 10 or anything else, choose a format and separator, pad numbers with leading zeros so columns line up, and skip blank lines. It also works in reverse. It can remove line numbers from text copied out of code viewers, PDFs and websites that include them.

How to Add Line Numbers

  1. Paste your text or drop a file.
  2. Set the start number and increment, for example start at 10 and step by 10 for BASIC-style numbering.
  3. Choose a format, separator and padding.
  4. Copy or download the numbered text.

Formatting Options

SettingExample output
Format "1." + space1. First line
Format "[1]" + tab[1]    First line
Zero padding001 First line … 120 Last line
Space alignment  1 … 100 lined up on the right
Start 10, step 1010, 20, 30 …

Common Uses

  • Code snippets for tutorials, documentation, bug reports and code reviews.
  • Legal documents and transcripts, where lines are referenced precisely.
  • Poetry and scripts for study, analysis and rehearsal.
  • Lists and checklists that need numbering for sharing in plain-text channels like chat or email.
  • Data preparation, adding row IDs before importing into a spreadsheet or database.

Features

  • Custom start and stepAny starting number and increment, including negatives.
  • Seven formats1. / 1) / (1) / [1] / #1 / 1: / 1.
  • Six separatorsSpace, tab, dash, colon, pipe or none.
  • AlignmentZero padding or space alignment for neat columns.
  • Skip blank linesNumber only lines with content.
  • Remove numberingStrip line numbers from copied code or text.

Removing Line Numbers from Copied Code

When you copy code from a website, PDF or e-book, line numbers often come along and break the code. Choose "Remove existing line numbers" to strip them. The tool removes numbers at the start of each line in common formats like "12", "12.", "12)", "[12]" and "#12", along with the separator that follows, leaving your code intact. Check the result, since lines that genuinely start with a number (such as numeric data) will also lose it.

Line Numbers in Code and Documents

Code editors show line numbers in the margin, but they aren't part of the file, so they disappear when you copy code into an email, chat message, forum post or document. Adding real line numbers to the text keeps them visible wherever the code goes, which makes it easy to say "the bug is on line 17" in a review or support request. For long listings, zero padding keeps the code aligned so indentation stays readable, and a tab separator lets you paste the result into a spreadsheet with numbers and text in separate columns.

Legal and academic documents use line numbers for a similar reason: contracts, court transcripts, screenplays and manuscripts are often reviewed by several people who need to refer to exact lines. Numbering every fifth line is a common convention in poetry and textual criticism. Set the increment to 5 and tick "Skip blank lines" for that effect.

Tip: use "Remove existing line numbers" before re-numbering text that already has numbers.

Frequently Asked Questions

Can I number every fifth line?

Set the increment to 5 to count in fives (5, 10, 15…). Every line still receives a number.

Can I start numbering from a number other than 1?

Yes. Set "Start at" to any number, and the increment to any step.

How do I make numbers line up?

Choose "Leading zeros" (001, 002) or "Align with spaces" in Padding.

Can blank lines be skipped?

Yes. Tick "Skip blank lines" and empty lines stay unnumbered while numbering continues on the next line with text.

How do I remove line numbers from code?

Choose "Remove existing line numbers" as the action, then paste the code.

Is my text uploaded?

No. Everything is processed in your browser.