Number Lines Tool
Prefix every line with its line number.
Result
How it is calculated
The tool splits the text into lines wherever it finds a line break (Windows, Unix and old Mac line endings are all recognised) and puts a running counter in front of each line: line n → "n. " + text. Numbering always starts at 1 and increases by 1, followed by a full stop and a space. Blank lines are also numbered and counted, so an empty line in the middle still takes a number. The original text of each line is left untouched, including spaces at its start. If the box is empty there is no result. The output keeps one numbered line per input line, ready to copy and paste.
Worked example
Input of three lines: Milk, Bread and Eggs. Line 1 gets the prefix "1. ", line 2 gets "2. " and line 3 gets "3. ". The tool returns 1. Milk 2. Bread 3. Eggs with each numbered item on its own line. If you add a blank line between Bread and Eggs, Eggs becomes number 4, because the empty line is counted too.
Common mistakes
- Expecting a blank line to be skipped. It receives a number, which shifts everything after it.
- Pasting a text that is wrapped by the editor and expecting numbers per sentence. Only real line breaks start a new number, not wrapped lines.
- Trying to change the starting number or the separator. The tool always uses "1." style numbering.
- Numbering text that already has numbers or bullets, which ends up with double prefixes.
About this calculator
This tool adds a sequential line number as a prefix to every line of a block of text, turning an unnumbered list or block of text into one where each line's position is immediately visible, without manually counting or typing numbers one by one. It preserves the original line order and content, simply prepending the count.
It is used by developers and writers who need to reference specific lines when discussing a piece of text, a config file, or a code snippet — saying "see line 14" only works if the lines are actually numbered. It's also handy for numbering steps in an instruction list, items in a to-do list, or entries in any plain-text list pasted from somewhere that stripped the original numbering.
Was this helpful?
You can pick up to 3 reactions.
Popular calculators
Loan Calculator
Monthly payment, total interest and full amortization schedule.
Percentage Calculator
Percent change, percent of, and ratio calculations.
Discount Calculator
Calculate final price, savings, and discount amount.
BMI Calculator
Body mass index from height and weight (metric or imperial).
Age Calculator
Compute your exact age in years, months and days from a birth date.
Compound Interest Calculator
Calculate the final amount and interest earned with compounding.
All Calculators
No calculators found
Comments (0)