About the Add Line Numbers tool
Reviewing a script, a draft contract, song lyrics or a code snippet is easier when every line has a number to refer to. This tool lets you add line numbers to pasted text with full control over the starting number, the step between numbers, the separator and zero padding such as 001, and it can leave blank lines unnumbered so paragraphs keep their spacing.
Each line gets a number followed by the separator, such as "1. ", "1) ", "1: " or a tab, which pastes neatly into a spreadsheet as two columns. The step can be any whole number, so you can count in tens like old BASIC programs (10, 20, 30) or count down with a negative step. Zero padding makes every number the same width, so 01 to 99 line up, which looks tidy in monospaced text. Windows line endings are handled, and the line count stays exact even for very long texts.
Example: the lines "Buy milk", "Call the bank", a blank line and "Book dentist" become "1. Buy milk", "2. Call the bank", the blank line, and "3. Book dentist" with blank lines skipped. Starting at 10 with a step of 10 gives 10, 20 and 30.
To put each line in order first use the text sorter, to remove repeated lines the remove duplicate lines tool, and to add any text before or after each line the add prefix and suffix tool.
How to use the Add Line Numbers tool
- Paste your textEach line will get its own number.
- Set the numberingChoose the start number, the step and the separator.
- Choose the extrasZero padding, and whether blank lines are numbered.
- Copy the resultCopy it or download it as a .txt file.
Add Line Numbers features
- Any start number and step
- Separators: dot, bracket, colon, dash, tab or custom
- Zero padding for aligned numbers
- Skip or number blank lines
- Handles Windows and Mac line endings
- Copy or download
- Works on very long texts
Common uses
- Numbering lists and agendas
- Script and screenplay drafts
- Code snippets for teaching
- Legal and contract clauses
- Song lyrics and poems
Adding line numbers to text: for code, legal documents and scripts
Line numbers make it possible to refer to an exact place in a text: "see line 42" is far clearer than "near the middle of the second page". They are standard in code listings, legal documents, poems studied in class, scripts, transcripts and data review. This guide covers numbering formats, starting values, steps and padding, and the situations where each option matters.
Numbering options
| Option | Example | Why it helps |
|---|---|---|
| Start number | starting at 101 | continuing numbering from a previous section |
| Step | 1, 5, 10 | numbering every fifth line, as in poetry editions |
| Separator | "1. ", "1) ", "1: ", "1 tab" | matching a house style |
| Zero padding | 001, 002 ... 120 | keeping numbers aligned and sortable |
| Skip blank lines | blank lines left unnumbered | numbering only real content |
Zero padding and alignment
When a text has more than nine lines, numbers change width: line 9 is one digit, line 10 is two. Zero padding keeps everything aligned: 01 to 99, or 001 to 999. It also makes the numbered lines sort correctly as text, because "002" sorts before "010" while "2" would sort after "10" in a plain alphabetical sort.
Line numbers in code
Code listings in tutorials, documentation and printed exams often include line numbers so readers can follow explanations. Numbers should be clearly separated from the code, for example with a colon or a tab, so nobody mistakes them for part of the program. When sharing code that others will copy and run, provide an unnumbered version too, or put numbers in a separate column, because pasted line numbers break the code.
Legal and transcript documents
Court transcripts, depositions and some legal pleadings number lines on every page, commonly 1 to 25 or 1 to 28, so that citations such as "page 12, lines 4 to 9" are exact. For contracts, numbering paragraphs or clauses is more common than numbering every line.
Poetry and scripts
Poetry editions often number every fifth line, which is what a step of 5 with numbering reset to the right start gives. Theatre and film scripts sometimes number scenes or lines for rehearsals, letting a director say "from line 230" instead of searching for a cue.
Skipping blank lines
Blank lines separating paragraphs or stanzas usually should not receive numbers, because they contain nothing to refer to. Skipping them keeps numbers meaningful. For code, numbering every line including blank ones matches what code editors show, which is often what readers expect.
A worked example: a reading passage for a class
A teacher prepares a 60-line poem for a lesson. Numbering every fifth line, starting at 1, with right-aligned numbers, matches the style of printed anthologies and keeps the page uncluttered. Students can now discuss "the image in lines 23 and 24", and everyone finds the place immediately. The teacher pastes the numbered poem into a document, prints it and keeps an unnumbered copy for display on screen.
Removing line numbers later
If you receive text with line numbers that you need to remove, such as code copied from a tutorial, a regex replacement can strip them: in Find and Replace Text, replace ^\d+[.:)]?\s* with nothing in multi-line mode. Check the result, because lines that genuinely start with numbers will be affected too.
Related tools
To add other text at the start of each line, such as bullets or quotes, use Add Prefix and Suffix to Lines.
Numbering for reviews and feedback
When several people review a draft, line numbers make feedback precise. Comments such as "line 47: replace 'affect' with 'effect'" can be applied quickly without hunting through the text. Academic journals and grant reviewers often ask for line-numbered manuscripts for exactly this reason. Number the draft before sending it out, and keep an unnumbered copy for further editing.
Numbering data rows
Numbered lines also help when checking data. If a list of 500 email addresses must be verified by two people, numbers let them divide the work, such as lines 1 to 250 and 251 to 500, and report problems by line number. Afterwards, the numbers can be removed again before importing the list.
Printing numbered text
For printed handouts, a monospaced font keeps numbers and text aligned, especially for code. Use a clear separator such as a tab or a colon followed by a space, and leave enough margin on the left. If the text wraps onto a second line, the wrapped part has no number, which is correct, because it is still the same line of the original.
Consistent numbering across documents
When a long text is split across several files or pages, set the start number of each part to continue from the previous one. Readers can then cite any line uniquely across the whole set, which matters for transcripts, legal bundles and multi-part code listings.
Privacy
Line numbers are added in your browser. Code, legal text and scripts are never uploaded.
Frequently asked questions
How do I add line numbers to text?
Paste the text into the box and every line is numbered at once, using 1., 2., 3. by default. Change the start number, the step or the separator in the options, then copy the result or download it.
Can I skip blank lines?
Yes. With skip blank lines turned on, empty lines stay empty and the numbering continues on the next line with text. Turn it off to give every line, including empty ones, its own number.
How do I number lines in Word or Google Docs?
Word has Line Numbers under Layout, and Google Docs offers a numbered list format, but both number on the page only. This tool puts the numbers into the text itself, so they survive copying anywhere.
Can I start numbering from a number other than 1?
Yes. Set any starting number, such as 0, 100 or 2026. You can also set the step, for example 10 to number 10, 20, 30, or a negative step to count down.
What is zero padding?
Adding leading zeros so every number has the same width: 01, 02 … 10 instead of 1, 2 … 10. It keeps the text aligned when there are more than nine lines.
Can I paste the numbered text into Excel?
Yes. Choose the tab separator, and Excel or Google Sheets puts the numbers in one column and the text in the next column when you paste.
Does it work with code?
Yes. Each line of code gets a number, which is handy for documentation, code reviews or teaching. Leading spaces in the code are kept, so indentation is preserved.
Is there a limit on the number of lines?
No fixed limit. The tool runs in your browser and handles tens of thousands of lines quickly. Your text is not uploaded anywhere.Nothing is stored after you close the page.