Line Numberer
Add line numbers to a block of text.
About this tool
Padding uses the width of the last number unless you turn padding off.
A blank line is still numbered.
How to use it
- Open this page and provide the input it asks for.
- Set the options that are visible, then use Number lines.
- Read the result in the panel. Copy it or download it when a file is offered. The input stays in this browser.
Limitations
- A blank line is still numbered.
Numbers on every row, blanks included
What receives a number
After newlines are normalized, each row gets a number, including a blank row. The blank row is still a row. A trailing newline can create a final empty numbered row, which is the same rule the line counter uses when it counts a final empty line. The numbers start at the page’s start value and step by one. They are text prefixes, not a selectable list widget. The original line follows the number on the same row.
Padding and later edits
If numbers are padded so that 1 and 10 line up, the padding is spaces or zeros as the control defines. Those characters are now part of the line. A later duplicate-line remover will treat “1 apple” and “2 apple” as different. A sort of the numbered lines sorts the numbers as text unless they are zero-padded to the same width, in which case text order and numeric order agree for non-negative integers. Number last if you want numbers to reflect the final order. Number first if you want a stable id for the original row, and do not sort afterward if that id should stay in order.
What it will not number
It does not number words, sentences, or Markdown headings specially. A heading is a line. It does not restart numbering under each heading. It does not know about wrapped visual lines. One hard line, one number.
Padding decides whether a later text sort works
Unpadded numbers sort as text into the order 1, 10, 2. Zero-padding to the same width avoids that for non-negative integers. Add the numbers after you sort the rows if the numbers should count the new order. Add them before if they are an id for the original row, and then avoid a text sort that would scramble those ids.
Privacy
Your input is processed in your browser and is not uploaded to UtilChain. File names, text, and results are not sent to analytics.

