ToolNimba Browse

🔢 Add Line Numbers to Text

By ToolNimba Text Team · Updated 2026-06-19

Options
0
Lines in
0
Lines numbered

Paste some text above to add line numbers.

This tool adds a line number to the front of every line in your text. Paste your content, pick a start number and a separator style, and you get a clean numbered list you can copy straight back out. You can zero-pad the numbers so they line up, and skip blank lines so they do not get counted. Everything runs in your browser, so your text never leaves the page.

What is the Add Line Numbers?

Adding line numbers means writing a running count at the start of each line: 1, 2, 3 and so on, followed by a separator such as a dot, a parenthesis, a colon or a tab. The number itself is just the position of the line in the list, and the separator is the small piece of punctuation that keeps the number visually apart from the text that follows. Because the numbering is purely positional, the only real choices are where to start counting, how to mark the boundary, and whether blank lines should take a number of their own.

The start number matters more often than people expect. Source code is conventionally numbered from 1, but if you are continuing a list that already ran to line 40, you want the next block to start at 41 so the numbers stay consistent. Some tools and editors number from 0. This tool lets you set any start value, including negative numbers, and it counts upward from there one line at a time.

Zero-padding keeps the numbers the same width so the text after them lines up in a neat column. Without padding, the jump from line 9 to line 10 shifts every following line one character to the right. Padding to a fixed width (for example 001, 002 up to 010, 011) keeps a tidy left margin, which is helpful when you paste the result into a monospaced document, a code comment, or a printed handout.

When to use it

  • Numbering the lines of a code snippet before pasting it into documentation or a bug report.
  • Turning a plain list of items into a numbered list for an email, a checklist, or printed instructions.
  • Adding reference numbers to lines of a script, a transcript, or a set of survey questions.
  • Continuing the numbering of a long document from a specific starting value instead of always from one.

How to use the Add Line Numbers

  1. Paste or type your text into the input box, one entry per line.
  2. Set the start number (the value the first numbered line should use).
  3. Choose a separator style: dot, parenthesis, colon, dash, tab, or a single space.
  4. Optionally set a zero-pad width so the numbers line up, and tick skip blank lines if you do not want empty lines numbered.
  5. Copy the numbered result from the output box.

Formula & method

For each line i (starting at 0), the number shown is start + i. The output line is: number + separator + original line. With zero-padding to width w, the number is left-padded with zeros until it is at least w characters wide.

Worked examples

Three lines (apple, banana, cherry), start number 1, dot-and-space separator, no padding.

  1. Line 1 number = 1 + 0 = 1, output: "1. apple"
  2. Line 2 number = 1 + 1 = 2, output: "2. banana"
  3. Line 3 number = 1 + 2 = 3, output: "3. cherry"

Result: 1. apple / 2. banana / 3. cherry

Ten lines, start number 1, zero-pad width 2, colon-and-space separator.

  1. The first nine numbers (1 to 9) are padded to two digits: 01, 02, up to 09.
  2. Line 1 becomes "01: ...", line 9 becomes "09: ...".
  3. Line 10 is already two digits, so it stays "10: ...".
  4. Every number is now two characters wide, so the text after the colon stays in one column.

Result: 01: ... up to 10: ... , all aligned

A block continuing a document, start number 41, parenthesis-and-space separator.

  1. The first line takes number 41, output: "41) ..."
  2. The second line takes 41 + 1 = 42, output: "42) ..."
  3. Counting continues upward from the chosen start value.

Result: 41) ... , 42) ... , 43) ... and so on

Separator styles and how the first line looks

SeparatorExample output
Dot and space1. your text
Parenthesis and space1) your text
Colon and space1: your text
Dash1 - your text
Tab1[tab]your text
Single space1 your text

How zero-pad width changes the numbers

Pad widthLine 1Line 9Line 10Line 100
0 (off)1910100
2010910100
3001009010100

Common mistakes to avoid

  • Forgetting that blank lines are counted by default. By default an empty line gets its own number, which shifts everything below it. If you only want real content numbered, tick skip blank lines so empty lines are passed over (or dropped) instead of consuming a number.
  • Expecting the numbers to line up without padding. Without zero-padding, the number 9 is one digit and 10 is two, so the text after them no longer starts in the same column. Set a pad width at least as wide as your largest number to keep a clean left margin.
  • Leaving the start number at 1 when continuing a list. If you are extending a document that already reached line 40, starting again at 1 breaks the sequence. Set the start number to the next value you need (for example 41) so the numbering stays continuous.
  • Mixing tab and space separators in one document. A tab separator aligns differently from a fixed string of spaces depending on the viewer. If alignment must be exact everywhere, prefer a visible separator like a dot plus zero-padding rather than relying on tab stops.

Glossary

Line number
A running count placed at the start of a line to mark its position in the text.
Separator
The small piece of punctuation between the number and the line text, such as a dot, parenthesis, colon, dash, tab, or space.
Zero-padding
Adding leading zeros so every number is the same width, for example 001, 002, 010, which keeps the following text aligned.
Start number
The value given to the first numbered line. Counting then increases by one for each following numbered line.
Blank line
A line that is empty or contains only spaces. You can choose whether these lines are numbered or skipped.

Frequently asked questions

How do I add line numbers to my text?

Paste your text into the input box, choose a start number and a separator style, then copy the numbered result from the output box. The tool adds a number to the front of every line automatically as you type.

Can I start numbering from a value other than 1?

Yes. Set the start number field to any whole number, including 0 or a negative value, and the first numbered line will use that value. Each following line counts up by one from there.

How do I make the numbers line up?

Use the zero-pad width option. Setting it to the number of digits in your largest line number (for example 3 for up to 999 lines) pads shorter numbers with leading zeros, so 1 becomes 001 and every line starts in the same column.

Can I skip blank lines so they are not numbered?

Yes. Tick skip blank lines and empty lines will not receive a number. There is also an option to keep those blank lines in the output (just without a number) if you want to preserve the spacing.

What separator styles can I use?

You can pick a dot and space (1. ), a parenthesis and space (1) ), a colon and space (1: ), a dash (1 - ), a tab, or a single space. Choose whichever fits where you will paste the result.

Is my text sent anywhere or stored?

No. The numbering runs entirely in your browser using JavaScript, so your text never leaves the page and nothing is uploaded or stored on a server.