Utilia

Add Line Numbers

Add line numbers to any text online. Choose the start number, step and format (1. 1) 001), pad with zeros or spaces and skip empty lines.

How to add line numbers

  1. Paste your text in the input box. Each line of the text gets its own number.
  2. Set Start at (1 by default; 0 and negative numbers work too) and the Step between two numbers, for example 10 to get 10, 20, 30.
  3. Choose a Format: 1., 1), 1, 1:, 1 -, [1], #1 or 1 + tab. Pick Custom… to write your own, using {n} where the number goes.
  4. Choose a Padding if the numbers should line up, and a number of Digits (0 = automatic).
  5. Tick Skip empty lines if blank lines should stay unnumbered.
  6. The numbered text appears in the result box as you type. Add line numbers refreshes it; copy the result when you’re done.

Formats and custom templates

The format is a small template placed in front of each line. The presets cover the most common styles: numbered lists (1.), outlines (1)), references ([1]), tickets or issues (#1) and a tab after the number, which pastes neatly into two spreadsheet columns.

With Custom…, anything you type is kept literally and {n} is replaced by the number. A few examples:

Custom format Result
Line {n}: Line 1: first line
{n} → 1 → first line
Q{n}. Q1. first question
<{n}> <1> first line

If the format doesn’t contain {n}, the number is placed first and the text you typed follows it, so | gives 1 | text. You can also use {n} twice, for example to build labels.

Padding and alignment

Without padding, numbers grow from 1 to 10 and the text shifts by one character after line 9. Two padding styles keep everything aligned:

  • Leading zeros (01, 02 … 10) gives numbers of equal width, like 001, 002 … 120. This is handy for file names and for anything sorted alphabetically, because 002 sorts before 010 while 2 sorts after 10.
  • Spaces, right-aligned puts spaces in front of short numbers, like the line numbers in a code editor.

With Digits (0 = automatic) set to 0, the width is that of the largest number in your text: 2 digits for 10 to 99 lines, 3 digits for 100 to 999. Enter a number to force a width, for example 3 to get 001 even for a short list. Negative numbers keep their sign in front: -01.

Empty lines

By default every line is numbered, blank ones included, which matches the line numbers of a code editor or a log file. With Skip empty lines, lines that are empty or contain only spaces receive no number and don’t advance the counter: a list with blank lines between paragraphs is numbered 1, 2, 3 without gaps. The original line breaks, including Windows line endings, are kept.

Frequently asked questions

Can I start numbering at 0 or count down?

Yes. Start at accepts 0 and negative numbers, and a negative Step counts down: start at 10 with step -1 to get 10, 9, 8…

How do I number only paragraphs?

Put a blank line between paragraphs and tick Skip empty lines. Each paragraph that fits on one line then gets its own number.

How do I get numbers like 001, 002, 003?

Choose Leading zeros (01, 02 … 10) as the padding and set Digits (0 = automatic) to 3, with the 1 format.

Can I remove line numbers afterwards?

This tool only adds numbers. To remove them, use a find and replace tool with a regular expression such as ^\d+\.\s that matches the number at the start of each line.

Is my text uploaded?

No. The numbering is done in your browser and nothing is sent or stored.