UTILS.
100% in-browser
🔢

Add Line Numbers to Text

Add sequential line numbers to text or strip existing ones, with custom start, step, separator, zero-padding and skip-blank-line options.

— output appears here —

About this tool

This tool prefixes each line of your text with a running number, or removes numbers you already have. It is handy for referencing code, quoting passages, building numbered lists or preparing text for a discussion where people need to point at specific lines. Everything happens in your browser and nothing is sent anywhere.

In Add mode the text is split on line breaks and each line gets its number, which starts at the Start value and increases by the Step you choose (so you can number 1, 2, 3… or 0, 5, 10…). The Separator sits between the number and the line — a period and space by default, but you can use a colon, a pipe, a tab or anything you like. Turn on zero-padding to align every number to the same width (for example 001, 002 … 100), and turn on skip blank lines to leave empty lines unnumbered so they do not consume a count. Switch to Remove mode to strip a leading number and its trailing separator from every line, undoing numbering from this or another source.

The output preserves your original line order and is fully copyable. Because it is pure string processing, it handles thousands of lines instantly and never alters the content of a line beyond adding or removing the number at its start.

Frequently asked questions

Can I start numbering from a value other than 1?
Yes. Set the Start field to any number — including 0 or a negative number — and the Step field to control the increment, so you can produce 1, 2, 3, or 0, 2, 4, or 100, 105, 110, and so on.
How do I keep the numbers aligned?
Enable zero-padding. Every number is padded with leading zeros to the width of the largest one, so 1 through 100 become 001 through 100 and stay neatly aligned in monospace views.
What does 'skip blank lines' do?
With it on, empty lines are left as-is and do not receive a number or advance the counter, so only lines with content are numbered. With it off, every line including blanks is numbered.
Can it remove existing line numbers?
Yes. Choose Remove mode and it strips a leading number plus common separators (period, colon, parenthesis, dash, pipe, tab or spaces) from the start of each line, leaving the rest of the line untouched.

More tools