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.
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.
- Select "Add numbers" to prefix each line, or "Remove numbers" to strip an existing numbering scheme.
- Paste or type your text into the input area — every newline becomes a numbered line.
- Set the starting number (for example, 0 for offsets or 100 to continue an existing list).
- Choose a padding style — None, Zero (01, 02) or Space ( 1, 2) — to keep numbers aligned in monospace output.
- 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 | Line 1 | Line 12 |
|---|---|---|
| None | 1. text | 12. text |
| Zero | 01. text | 12. text |
| Space | 1. text | 12. 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
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
Sort Text Lines
Sort lines of text alphabetically, numerically, or reverse. Case-insensitive option, remove duplicates, and trim whitespace. Free online line sorter.
Remove Line Breaks
Remove line breaks and paragraph breaks from text online. Replace breaks with spaces, keep paragraphs, and strip extra spaces. Free and private.
Remove Duplicate Lines
Remove duplicate lines from text online. Case-sensitive or insensitive matching. Preserves order or sorts alphabetically. Free online tool.
Word Counter
Count words, characters, sentences, and paragraphs, and estimate reading time. Free, instant, and private — ideal for essays, articles, and posts.
Case Converter
Convert text to camelCase, PascalCase, snake_case, kebab-case, UPPERCASE, lowercase, Title Case, and Sentence case instantly.
Lorem Ipsum Generator
Generate Lorem Ipsum placeholder text in paragraphs, sentences, or words. Optionally wrap in HTML paragraph tags.
Explore all Text Tools.