ToolNimba

πŸ”’ Add Line Numbers to Text Online

By ToolNimba Text Team Β· Updated 2026-06-21

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. An online tool like this one does that counting instantly, even for thousands of lines, which is far faster than typing numbers by hand or fighting with the column tools built into a desktop editor.

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. That flexibility is what separates a real numbering utility from a simple list maker that always begins at 1.

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. The general rule is to pad to the digit count of your largest number, so a 250 line file needs a width of 3.

The separator is more than cosmetic. A dot and space (1. ) reads as a classic numbered list and is what most word processors auto-format. A parenthesis (1) ) is common in legal and academic outlines. A colon (1: ) suits logs and key-value style notes. A tab or a bare space is best when the numbered text will be parsed again later by a script or imported into a spreadsheet, because a single predictable delimiter is easy to split on. Choosing the separator to match where the text is going prevents extra cleanup later.

Deciding how to treat blank lines is the other quiet but important choice. By default every line, empty or not, takes the next number, which keeps the count matching the true line position in a file (useful when the numbers must agree with an editor or an error message). If you only care about real content, skipping blank lines gives a continuous 1, 2, 3 sequence with no gaps, which looks cleaner in a printed list. Knowing which behavior you need before you start saves you from renumbering afterwards.

People reach for this tool for two broad reasons: making something readable for humans, such as a numbered checklist or a quoted code block in a bug report, and making something machine friendly, such as adding stable reference IDs to rows before importing them. The same simple operation serves both, and because it runs entirely in the browser, even sensitive text like server logs, draft contracts or private notes can be numbered without uploading anything to a server.

When to use it

  • Numbering the lines of a code snippet before pasting it into documentation, a forum post, or a bug report so reviewers can refer to "line 14".
  • Turning a plain list of items into a numbered list for an email, a checklist, or printed instructions without retyping each number.
  • Adding reference numbers to lines of a script, a transcript, or a set of survey questions so they can be cited precisely.
  • Continuing the numbering of a long document from a specific starting value (for example 41) instead of always starting from one.
  • Creating stable row IDs in front of data lines before pasting them into a spreadsheet or a database import.
  • Counting how many non-empty entries a list contains by reading the final number after skipping blank lines.

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 and paste it wherever you need it.

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

A list with a blank line in the middle, start number 1, skip blank lines turned on.

  1. The first content line takes number 1.
  2. The blank line is passed over and does not consume a number.
  3. The next content line takes number 2, keeping a gap-free sequence.

Result: 1. first / (blank, no number) / 2. second

Separator styles and how the first line looks

SeparatorExample outputBest for
Dot and space1. your textClassic numbered lists, documents
Parenthesis and space1) your textOutlines, legal and academic lists
Colon and space1: your textLogs, notes, key-value style
Dash1 - your textReadable plain-text lists
Tab1[tab]your textPasting into spreadsheets
Single space1 your textCompact output, later parsing

How zero-pad width changes the numbers

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

How to add line numbers in common apps versus this tool

WhereMethodNotes
This toolPaste, set options, copyInstant, any start value, zero-padding, skip blanks
Notepad++Edit, then Column Editor, then Number to InsertBlock-cursor steps, no easy skip-blank
VS CodeLine numbers are display only in the gutterNumbers are not inserted into the text
Microsoft WordUse a numbered-list styleNumbers are formatting, not real characters
ExcelFormula =ROW() in a helper columnNumbers per row, not per text line

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.
  • Confusing display line numbers with inserted ones. Editors like VS Code show numbers in a side gutter that are never part of the text. If you copy the code, those numbers do not come along. Use this tool when you actually need the numbers embedded in the content.
  • Numbering wrapped lines instead of real lines. A long sentence that visually wraps is still one line of text and gets one number. If you expected one number per visual row, hard-break the text into separate lines first, then number it.

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.
Prefix
Text placed before each line. When numbering, the number plus separator acts as a generated prefix.
Delimiter
Any single, predictable character (such as a tab) used to split the number from the line text when the output is parsed again later.
Enumerate
To assign a sequential number to each item in a list, which is exactly what adding line numbers does.

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. This makes it safe for logs, drafts, and private notes.

How is this different from line numbers in VS Code or Notepad++?

Editors show line numbers in a side gutter for reference only, and those numbers are not part of the text, so they vanish when you copy. This tool inserts the numbers into the text itself, so they stay when you paste anywhere.

How do I add line numbers in Notepad++?

Place the cursor at the start of the first line, open Edit then Column Editor, and use Number to Insert with your starting value. It works but takes several steps and cannot easily skip blank lines, which is why a paste-and-copy tool is often quicker.

Can I number a very large list of lines?

Yes. The numbering is a simple, fast operation that handles thousands of lines instantly in the browser. Performance depends only on your device, not on a server, so even long files number in a moment.

Can I put the number after the line instead of before it?

This tool prefixes each line with its number, which is the standard layout for numbered lists and code references. If you need a trailing number, add the numbers first, then move them with a separate find-and-replace step.