Add Line Numbers

Add line numbers to text. Customize start number, separator, and zero-padding. Free online line numbering tool.

What is Add Line Numbers?

A line number tool prepends sequential numbers to each line of text, creating numbered lists from plain text. This is essential for code review discussions (referencing specific lines), creating numbered instructions, preparing legal documents with line references, and any context where you need to reference specific lines by number. Options typically include customizing the starting number, separator character, and padding format.

How It Works

The tool splits your input on newline characters, then prepends each line with its sequential number followed by your chosen separator (period, colon, tab, or custom string). You can set the starting number, choose whether to pad numbers with leading zeros for alignment (e.g., 01, 02 ... 99), and optionally skip empty lines. The numbered output maintains all original line content and formatting while adding the line reference prefix.

Common Use Cases

  • •Preparing code snippets for review where team members reference specific line numbers
  • •Creating numbered step-by-step instructions from plain text notes
  • •Adding line references to legal documents, contracts, or regulatory filings
  • •Numbering paragraphs in academic papers for peer review reference
  • •Creating numbered lists from bullet-point content for clearer sequencing
  • •Preparing transcript text with line numbers for citation and reference purposes

Frequently Asked Questions

Can I customize the numbering format?▼

Yes, you can set the starting number, separator character, and enable zero-padding.

Can I start numbering from a value other than 1?▼

Yes. Set the starting number to match the context you are pasting into — for example start at 42 when you are quoting an excerpt that begins on line 42 of a source file, so the numbers line up with the original.

What separator should I use between the number and the text?▼

A colon and space (`1: text`) is the most readable for prose. Use a tab if you plan to paste the result into a spreadsheet, because the number and the text will then land in separate columns. Use a period (`1. text`) if you want the output to render as an ordered list in Markdown.

Will the numbers stay aligned past line 9?▼

Enable zero-padding or right-alignment. Without it, line 9 and line 10 have different widths and the text column becomes ragged. Padding to the width of the highest line number keeps everything in a straight column.

Does it count blank lines?▼

By default yes, because that matches how code editors and compilers number lines. If you are numbering paragraphs rather than lines, use the option to skip empty lines so the count reflects only lines with content.

How do I remove line numbers again?▼

Numbering is not reversible from this tool, but the Find and Replace tool will strip them: match the regular expression `^\d+[:.)\t ]\s*` and replace it with nothing.

Related Tools

More from Text Tools: