KKwikfig.

Add Line Numbers

Add line numbers to any block of text with your choice of starting number, step, zero-padding and separator — ready to paste into documents and code. Runs entirely in your browser — your numbers never leave this device.

Text
Numbered

How it works

Number on the n-th line = start + (n − 1) × step, formatted with optional zero-padding to a fixed width, followed by the separator (default “. ”)

Paste any block of text and every line is prefixed with a number, in order, without altering the lines themselves. Numbering starts at 1 by default and increases by 1 per line; both values are yours to set, so a list that continues from a previous document can start at 41, and a sequence that must match an external scheme — every fifth line of a transcript, even-numbered items only — can step by 5, 2 or any other amount. The arithmetic is exactly start + (line position − 1) × step, printed under each example so you can check the tool against your own count.

Zero-padding formats every number to the same width — 01, 02, … 10, 11 — which keeps the numbers vertically aligned in a monospace document and, more importantly, keeps a later alphabetical sort in the correct order (unpadded, line 10 sorts before line 2). The separator between number and text is also configurable: “. ” by default, but a tab, a colon or “) ” may suit your document better. Blank lines are numbered too — a line is a line, whether or not it carries text — which keeps the numbering aligned with editors that count blank lines the same way.

Numbering happens in your browser; the text you number is never uploaded or stored. If you later need the numbers gone, Find and Replace in regex mode removes a leading number-and-separator pattern from every line in one pass.

Worked examples

Zero-padded numbering for two lines

Input
a b (2 lines), Padding = 2
Working
Numbers 1 and 2 are padded to two digits, then followed by the default “. ” separator.
Result
01. a — 02. b

Custom start and step

Input
a b (2 lines), Start = 10, Step = 5
Working
First line: 10 + 0 × 5 = 10. Second line: 10 + 1 × 5 = 15.
Result
10. a — 15. b

The plain default

Input
only (a single line), all settings default
Working
One line, starting at 1 with step 1 and no padding, followed by “. ”.
Result
1. only

Frequently asked questions

Why zero-pad the numbers?

Alignment and sortability. Padded numbers (01, 02, …, 10) line up in fixed-width text and sort correctly as text. Unpadded numbers sort as characters, so 1, 10, 11, 2 is the order a plain alphabetical sort produces. Pad to the width of your largest number — two digits up to line 99, three up to 999.

Are blank lines numbered?

Yes. Every line in the input receives the next number, including empty ones, so the numbering matches what a text editor shows in its gutter. If your blank lines are paragraph separators and you do not want them numbered, remove them first or accept the numbering as a record of the true line positions.

How do I continue numbering from a previous block?

Set Start to the next number. If a previous block ended at line 40, set Start = 41 and step 1, and the new block continues seamlessly. The same idea serves excerpts: a passage beginning at line 200 of a source can be numbered from 200 so references still match the original.

How do I remove line numbers I added earlier?

Use a regex replace with multiline mode enabled (any text editor offers one): search for ^\d+\. followed by your separator — a number, a dot and a space at the start of each line — and replace with nothing. Because the numbers were added mechanically, in a fixed pattern, they can be removed mechanically in one pass.

Can I number with letters or Roman numerals instead?

Not in this tool — it produces decimal numbers, which is what line references, code reviews and document markups use. If a document style demands Roman-numeral or letter labels, apply them in your word processor's list settings, where the numbering is a style rather than baked-in text.

Is my text stored anywhere?

No. Numbering runs in your browser; your text is never uploaded, stored or tracked.

Related tools

More in Text Tools · Browse all tools