Skip to main content
ToolsHub

Add Line Numbers

Paste text to prepend line numbers with your chosen start value, padding, and separator — and reverse it just as easily. In your browser.

Files never leave your browser
Mode

How to use Add Line Numbers

Add line numbers to any text or source code entirely in your browser — nothing is uploaded to a server. Choose the starting value, align the numbers with zero- or space-padding, and pick the separator that goes between each number and its line (a period, colon, parenthesis, or tab). A reverse mode strips existing numbers back out, so you can clean up pasted snippets or renumber a list in seconds.

  1. Select "Add numbers" to prefix each line, or "Remove numbers" to strip an existing numbering scheme.
  2. Paste or type your text into the input area — every newline becomes a numbered line.
  3. Set the starting number (for example, 0 for offsets or 100 to continue an existing list).
  4. Choose a padding style — None, Zero (01, 02) or Space ( 1, 2) — to keep numbers aligned in monospace output.
  5. Pick a separator (period, colon, parenthesis, or tab) and copy or download the numbered result.

Your data never leaves your device — 100% private processing.

Padding and alignment for monospace output

When a list crosses from single to double digits, unpadded numbers leave a ragged left edge — "9." sits one character narrower than "10.". Zero-padding pads every number to the width of the largest value (01, 02 … 12) so columns line up and the result sorts correctly as text. Space-padding does the same visually ( 1, 2 … 12) without altering the numeric characters, which is ideal for code listings, transcripts, and numbered references displayed in a monospace font. The tool computes the required width from the final line number automatically.

Padding styles for a 12-line list
PaddingLine 1Line 12
None1. text12. text
Zero01. text12. text
Space 1. text12. text

Removing line numbers from pasted snippets

Code copied from documentation, blog posts, terminals, or PDF exports frequently arrives with line numbers baked into every line — "1. ", "2: ", "3) " or a tab-separated index. The remove mode applies a tolerant pattern that strips an optional leading space, one or more digits, and a common separator character (period, colon, parenthesis, hyphen, tab, or space) from the start of each line. Lines that do not begin with a number are left untouched, so prose mixed with numbered items survives intact. This makes it easy to paste a numbered snippet, strip the prefixes, and recompile or re-run the clean code.

Glossary

Line number
A sequential index prefixed to each line of text, typically starting at 1, used to reference specific lines in code reviews, logs, and documentation.
Zero padding
Filling a number with leading zeros to a fixed width (01, 02) so values of different magnitudes align and sort consistently as text.
Separator
The character or characters placed between a line number and its content — commonly a period, colon, parenthesis, or tab.
Monospace font
A typeface in which every character occupies the same horizontal width, making padded line numbers align into clean columns.
Offset start
Beginning the numbering from a value other than 1 — for example 0 for array indices, or 100 to continue an existing numbered list.

Related reading

Frequently Asked Questions

Free · No spam

Get weekly tool tips & updates

New tools, power-user tips, and productivity hacks — delivered free every Friday.

No spam, ever. Unsubscribe with one click.

Why use Add Line Numbers?

  • Instant results with no signup or account creation
  • Works offline once the page is loaded
  • Supports Unicode and multilingual text
  • Copy results to clipboard with a single click

Common use cases

  • Count words in an essay before submission
  • Sort a list of items alphabetically
  • Remove duplicate lines from CSV exports
  • Change the case of text copied from PDFs
  • Find and replace text across large documents

Related Text Tools

Explore all Text Tools.