Add Line Numbers

Add line numbers to any text. Formats with aligned padding and a separator — ready for code reviews, documentation, or sharing.

Your data never leaves your browser

How to Use

  1. 1

    Paste your text or code

    Enter the text you want to number in the input area.

  2. 2

    Click Add Numbers

    Each line gets a number prefix, padded for alignment.

  3. 3

    Copy the result

    Click Copy to copy the numbered text.

What is Add Line Numbers?

This tool prepends a line number to every line in a block of text. Numbers are right-aligned and padded for consistent formatting, separated from the content by a pipe character (|). The result is ready for code reviews, bug reports, documentation, or any context where referencing specific lines is helpful.

FAQ

What format are the line numbers?
Numbers are right-aligned with space padding and followed by ' | '. For example: ' 1 | first line', ' 2 | second line', ..., '10 | tenth line'.
Does it number empty lines?
Yes, every line is numbered including blank lines.
Can I customize the numbering format (e.g., padding or separator)?
The tool adds line numbers with a consistent format — each number is right-aligned and followed by a separator (pipe or colon). This ensures clean alignment even for files with hundreds of lines.

Related Articles

Related Tools