Add Line Numbers
Add line numbers to any text, with a custom starting number and format. Paste, number, copy. No signup. Ideal for code, references, transcripts and numbered lists.
Result
| Numbered Text |
|---|
Share on Social Media:
This tool adds line numbers to any text, numbering every line with your chosen starting number and format, directly in your browser. Paste your text, set the options, and copy the numbered result. No account, no install, so you can number lines of code, a transcript, a reference list or any text on any device in seconds.
How to Add Line Numbers Step by Step
- Paste your text. Drop your text into the input box, one item or statement per line. Each line will receive a number, so the line breaks in your text define what gets numbered.
- Set the starting number. Choose where the numbering begins. It usually starts at one, but you can start elsewhere, useful for continuing numbering from a previous section.
- Choose the format. Decide how the number appears: followed by a full stop, a bracket, a colon, or a space, and whether there is padding so numbers align neatly.
- Add the numbers. The tool prefixes each line with its number in your chosen format, turning plain lines into a clearly numbered list.
- Copy the numbered text. Copy the result into your document, code comment, reference or wherever you need numbered lines, ready to use with each line clearly labelled.

Why Numbering Lines Is Useful
Numbering lines gives every line a stable reference, which is surprisingly valuable. When lines are numbered, you can point precisely to line forty seven rather than describing a location vaguely. This is why code editors show line numbers, why legal documents number lines and paragraphs, and why transcripts and scripts are often numbered. A number turns an anonymous line into an addressable one that can be cited, discussed and found quickly.
In programming, line numbers are essential for communication and debugging. Error messages reference the line where something went wrong, code reviews discuss specific lines, and documentation points to lines in examples. While code editors show line numbers in the margin, sometimes you need the numbers embedded in the text itself, for pasting into a document, an email, or a context where the editor's margin numbers are not available.
Beyond code, numbered lines serve reference and citation. Legal documents, scripts, transcripts and academic texts number lines so that any part can be cited exactly. In a deposition transcript, a lawyer can refer to page and line. In a script, a director can call out a line number. This precision matters wherever people need to discuss a specific point in a shared text without ambiguity about which part they mean.
The format of the numbering affects readability and purpose. A number followed by a full stop reads as an ordered list. A number in brackets or followed by a colon suits code or references. Padding the numbers so they align, so single and double digit numbers line up, keeps the text tidy. Choosing the right format and starting point makes the numbered text fit its intended use, whether that is a list, a reference, or code.
This Tool Versus an Editor or Manual Numbering
| Method | Strengths | Weaknesses | Best for |
|---|---|---|---|
| This online tool | Numbers embedded in the text, custom format and start, any device | One block at a time | Numbered text to paste into documents, emails or references |
| Code editor margin numbers | Automatic, always visible while editing | Not part of the text, cannot be copied out easily | Editing code in the editor itself |
| Word processor list numbering | Integrated with the document | Tied to the document's list formatting | Ordered lists within a document |
| Manual numbering | No tools for a few lines | Slow, error prone, hard to renumber | Two or three lines you can number by hand |
Who Needs to Add Line Numbers

Pro Tips for Numbered Text
Common Line Numbering Mistakes to Avoid
Related Tools You May Need Next
To clean the text before numbering, our Whitespace Remover removes stray blank lines, and the Line Counter tells you how many lines you have. To sort the lines before numbering, the Sort Text Lines tool orders them.

Frequently Asked Questions
How do I add line numbers to text?
Paste your text into the input box, set the starting number and choose a format, such as a number followed by a full stop, a colon or a bracket, and the tool prefixes every line with its number. Copy the numbered result. Each line break in your text defines a line to be numbered, so the numbering follows the structure of your pasted content exactly.
Can I start numbering from a number other than one?
Yes. You can set the starting number to any value, which is useful when your text continues from a previous section and you want the numbering to carry on consistently rather than restarting at one. Choosing the right starting number keeps a multi part reference continuous, so line numbers remain unique and meaningful across the whole document or set of texts.
What number formats are available?
You can choose how the number appears before each line, commonly a number followed by a full stop for an ordered list feel, or followed by a colon, a bracket or a space for code and reference contexts. You can also pad the numbers so single and double digit numbers align neatly. Selecting a format that matches your purpose makes the numbered text read correctly for its use.
Why would I add line numbers to text?
Numbered lines make text addressable, so you can refer to a specific line precisely rather than describing its location. This is valuable for discussing code, citing legal documents, reviewing scripts and transcripts, and any situation where people need to point to an exact line in a shared text. Embedding the numbers in the text lets you paste it anywhere with the references intact.
Do blank lines get numbered?
Yes, by default every line, including blank ones, receives a number, since a blank line is still a line separated by line breaks. If you do not want blank lines counted, remove them before numbering using a whitespace tool, so only your real content lines are numbered. This gives a cleaner result where the numbers correspond only to lines with actual content.
How is this different from a code editor's line numbers?
A code editor shows line numbers in the margin as a display aid while you edit, but those numbers are not part of the text and cannot easily be copied out with it. This tool embeds the numbers into the text itself, so when you copy the result, the numbers come with it. That makes it ideal for pasting numbered code or text into documents, emails or messages.
Will the numbers stay correct if I edit the text?
No. The numbers are added based on the line positions at the time of numbering, so if you edit the text afterward, inserting, deleting or reordering lines, the numbers will no longer match the new positions. For accurate references, add the line numbers as a final step, or renumber the text after making any changes to the lines.
Is the add line numbers tool free?
Yes, it is completely free with no account and no usage limit. You can add line numbers to as many pieces of text as you like, as often as you like, with your chosen start and format, at no cost. It runs entirely in your browser on any device, so there is nothing to download or install, and your numbered text is ready to copy immediately.