What is the Add Line Numbers for?
A add line numbers to text is a free online tool that prefixes every line of pasted text with its number, so lines can be referenced in shared text It offers three formats — 1., 1:, and [1] — and numbering can start from any number, so a pasted excerpt keeps its original line numbers. It gives the answer instantly as you type, with the main result shown first and the supporting figures underneath, so you can check the headline number and the working behind it in one glance.
It is used by developers, teachers, and anyone sharing text that needs line references. A line counter gives the same text its line count, which is the number of lines this tool numbers.
To use it, enter the text, the number format, and the starting number. The tool runs entirely in your browser: nothing you type is uploaded, stored, or shared, and there is no sign-up. You can change any value and the results update at once, which makes it easy to test what happens when one input moves.
How to work out Add Line Numbers by hand
Line numbering is a prefix per line: the line number, a separator, and the line itself. The separator is the only choice: a dot, a colon, or brackets. The method the tool uses is: Each line gets its number plus the chosen separator: '1. ' for dot format, '1: ' for colon format, or '[1] ' for bracket format. Numbering starts from the number you choose.. Every part of that method has one meaning and one unit, and keeping the units straight is most of the work in getting a right answer.
By hand, the steps are: paste the text, pick the format, set the starting number, and copy the numbered result. The tool does the same steps in the same order, so a hand check on one example should land on the same number the page shows, allowing for the rounding in the display.
The result is a count: the number of lines numbered. Lines are split on line breaks, and every line gets a number, including empty lines, so the numbers match the lines exactly. The tool trusts the numbers you enter: it cannot tell whether a measurement was read correctly, so a wrong input gives a wrong-looking answer with no warning. Always check the units before trusting a result.
One more check: the method above is the one the page uses, so a book or chart that writes it differently is usually just rearranging the same relation or using different words. Match the quantities by their meaning, not by their shape, and the numbers will agree. If your source gives the answer in different units, convert at the end rather than in the middle, so a conversion slip cannot hide inside the working. When the answer sits close to a boundary, such as a band edge, a grade cut, or a target you must not cross, treat the displayed rounding as part of the check: a value shown as 15.0 might be 14.96 or 15.04 underneath, and the page rounds for display, not for judgement. If that edge matters, run the numbers once more with the full precision the inputs allow and read the exact result, not the rounded one. The same care applies when you change one input and the answer barely moves: a small change in an input can still matter if the result feeds a next step, so check the unrounded figure before you carry it forward.
Every line gets a number, including empty ones
Empty lines are numbered too, and that is deliberate. If the tool skipped them, the numbers would no longer match the lines: line 5 in the output would be line 6 in the original, and a reference to 'line 5' would point at the wrong text. Numbering every line keeps the reference exact.
The starting number exists for excerpts. A passage copied from the middle of a document keeps its original line numbers when the start is set to the first line's real number, so a reference to line 47 still means line 47 of the document, not line 1 of the excerpt.
The three formats cover the three common conventions. '1.' is the plain list style, '1:' is the style used in logs and transcripts, and '[1]' is the style used in code reviews and legal documents. The format changes nothing but the separator, so pick the one your reader expects.
A worked example
Take this example: three lines numbered in bracket format starting at 5. Bracket format starting at 5 is the excerpt case: lines taken from the middle of a longer document. Put those numbers into the tool and it returns Lines 3 lines numbered.
Working it through by hand: the three lines become [5] First line, [6] Second line, and [7] Third line, so 3 lines are numbered. The hand result matches the tool exactly, which is the point of the check: if your own working gives a different number, one of the inputs was typed in the wrong unit or the wrong box.
Try a second set to see how the answer moves: four lines in colon format starting at 1. the four lines become 1: Alpha, 2: Beta, 3: Gamma, and 4: Delta, so 4 lines are numbered Changing one input at a time and watching the result is the fastest way to build a feel for the method, and it is how most people spot a typing error before it matters.
Who uses a Add Line Numbers and why
Developers are the first group. A stack trace or a code snippet shared in a chat needs line references — 'the error is on line 12' — and numbered text makes that possible without a code editor.
Teachers are the second group. A poem or a passage for class discussion is easier to talk about when every line has a number, and the students can point at 'line 5' instead of quoting the whole line. A remove duplicate lines tool is a natural companion here, since the two jobs often come up in the same session.
Editors are the third group. A manuscript with numbered lines is easier to mark up, because every comment can cite a line number instead of describing where the problem is. None of these uses needs an account or an install: the page opens, the values go in, and the answer is there.
The common thread across all three groups is that a number beats a guess. A rough guess in the kitchen wastes ingredients, and a rough guess in a draft wastes a revision. Checking the number first costs seconds and saves the redo.
Add Line Numbers vs sort lines tool
A sort lines tool answers a different question: it sorts the lines of the same text alphabetically. The two tools look similar because they share inputs, but they solve for different unknowns, and picking the wrong one is the most common source of confusion between them.
Use this Add Line Numbers when the quantity you need is the one named in the title above. Use the sort lines tool when your unknown is the one it is named for instead. If a task gives you the answer this page produces and asks for something else, that something else is usually the job of the companion tool.
In practice the two are used back to back: work out the first quantity here, then carry it into the second tool as an input. Keeping the chain in that order, and writing each intermediate answer down, stops small rounding slips from growing into a wrong final answer.
Common mistakes with a Add Line Numbers
The first mistake is numbering a list that already has numbers. A numbered list pasted in gets a second set of numbers, and the two sets disagree. Strip the old numbers first, or number only the plain text.
The second is starting from 1 for an excerpt. A passage from the middle of a document keeps its meaning only when the start is set to the real first line number — otherwise every reference is off by the same amount.
The third is copying the numbered text back into code. Line numbers in code break the code: the numbers are text, not comments. Number for reference only, and keep the original for running. A quick habit that catches all three: work one example by hand, compare it with the tool, and only then trust the page for the rest of the job.
How to use this Add Line Numbers
Step one, enter the text, the number format, and the starting number. Step two, check the units beside each box match the units in your task. Step three, read the main result at the top of the results box, then the supporting figures below it.
For the most accurate results, use the most precise inputs you have, and keep the same unit system all the way through: mixing units is the single biggest cause of answers that are out by a factor of ten. Set the starting number to the real first line when pasting an excerpt, so references in the discussion match the original document.
The tool is free, works on a phone or a computer, and needs no sign-up. Everything runs in your browser, so your numbers never leave your device, and closing the page leaves nothing behind.
If the answer looks wrong, change one input at a time and watch which one moves the result. A result that jumps by a factor of ten usually means a unit slipped, while a result that barely moves when an input changes usually means that input matters less than expected. Both patterns are worth knowing.