Skip to content
MoneyDeck

Add Line Numbers

Number every line of text with your own start, step and format

Updated · Free, no signup

Numbered text

1. Preheat the oven
2. Mix the dry ingredients

3. Add the eggs
4. Bake for 25 minutes

Lines numbered

4

Total lines

5

Last number used

4
  • 1 blank line was left unnumbered.

About the Add Line Numbers

Add Line Numbers puts a number in front of every line of your text. Choose where counting starts, how much it goes up by each line, what goes between the number and the text (a full stop, bracket, colon, tab or pipe) and whether numbers are padded with zeros or spaces so they line up.

It is handy for numbering code snippets in documentation or a code review, turning a plain list into a numbered list, adding line references to legal drafts, transcripts, poems and scripts, and preparing data rows for import. Skipping blank lines keeps paragraph breaks unnumbered so the count matches the real content.

Lines are split on line breaks exactly as they appear, so a long paragraph that wraps on screen is still one line. The original text is not changed apart from the numbers added at the front, and everything happens in your browser.

How to use the add line numbers

  1. 1Paste your text with one item per line.
  2. 2Set the starting number and the increment.
  3. 3Choose what goes after the number, such as a full stop or a tab.
  4. 4Pick padding if you want the numbers to line up.
  5. 5Decide whether blank lines are skipped, then copy the result.

Formula and method

number for k-th numbered line = start + (k − 1) × increment

The text is split at each line break. Lines are numbered in order: the first numbered line gets the start value and each following numbered line adds the increment, so starting at 10 with an increment of 10 gives 10, 20, 30 (the classic BASIC style). When "skip blank lines" is on, empty or whitespace-only lines are kept in place but do not receive a number and do not advance the count.

Padding makes all numbers the same width as the widest one: zeros give 01 … 12 and spaces give right-aligned numbers, which keeps the text in a neat column in monospaced fonts. The separator you choose is inserted between the number and the original line, which is otherwise left exactly as it was.

Worked examples

Number recipe steps, skipping the blank line

Four steps are numbered 1 to 4 with a full stop and space. The blank third line stays where it is, unnumbered, so "Add the eggs" becomes step 3.

BASIC-style numbering in tens

Counting starts at 10 and rises by 10, with a single space after each number, the traditional way to number BASIC program lines.

Zero-padded numbers for 10+ lines

The widest number, 10, has two digits, so 1 to 9 are padded to 01 to 09, keeping every line aligned after the colon.

Frequently asked questions

How do I add line numbers to text?+

Paste the text, choose the start number, increment and separator, and copy the numbered result. Each line break starts a new numbered line, so make sure each item is on its own line.

Can I start numbering from a number other than 1?+

Yes. Set "Start at" to any whole number, including 0 or a negative number, and set the increment, for example start 100 and increment 5 gives 100, 105, 110 and so on.

How do I keep blank lines from getting a number?+

Leave "Skip blank lines" switched on. Empty lines stay in place for spacing but are not numbered and do not advance the count, so your numbering matches the actual items.

How do I make numbers line up in a column?+

Choose leading zeros (01, 02 … 10) or spaces padding. Every number is padded to the width of the largest, so the text after the numbers starts in the same column when viewed in a monospaced font.

How do I remove line numbers again?+

Use a find-and-replace tool with a regular expression such as ^\d+[.):]?\s* to delete numbers at the start of each line, or keep the original unnumbered text you pasted here.

Related tools