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
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.
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.
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.
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.
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.
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.
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.
No. Numbering runs in your browser; your text is never uploaded, stored or tracked.
More in Text Tools · Browse all tools