What Add Line Numbers does, and when you need it
Add Line Numbers puts a number in front of every line of a text: 1, 2, 3 and on. Choose how the number is written (1., 1), 1: or a number and a tab), where the count starts (1, 0, 10 or 100), and whether empty lines get a number. The numbered text appears in the second box as you paste, ready to copy or download, and a line under it says how many lines were numbered. The box with your own text is never changed.
It runs in your browser: your text is never uploaded and never saved, so closing the page forgets it.
Some jobs it is made for:
- A list for a form or an email: the documents you are sending, the steps of a process or the points of a complaint.
- Questions and answers, numbered before you paste them into a message or a document.
- Minutes, agendas and to-do lists, where people refer to items by number.
- Code, a log or a script, so that others can point to a line: "look at line 42".
- Poems and song lines for study, where lines are discussed by number.
Step by step: numbering lines
It takes a few seconds, and the same steps work on a phone and on a computer:
- Put your text in the top box, one item on each line. Paste it with the Paste button, with Ctrl+V, or by pressing and holding in the box on a phone. You can also type it, choose Open a text file, or drop a text file anywhere on the page. Press Try a sample to see it work first.
- Pick how the number is written under Number as:
1. Line,1) Line,1 then a tabor1: Line. - Pick where to start under Start at: 1, 0, 10 or 100.
- Leave Don't number empty lines ticked to skip blank lines, or untick it to number every line.
- Copy or download the result. Copy puts the numbered text on your clipboard; Download saves it as a text file.
Press Try a sample: the box fills with a short to-do list of four lines, one of them empty. The result is 1. Buy milk, 2. Pay the electricity bill, the empty line, and 3. Call the school, and the page says 3 lines numbered. Untick Don't number empty lines and the empty line becomes 3., so the last line is 4. Call the school.
How lines are numbered, exactly
The tool goes through the lines from the top and puts the next number and its mark in front of each. The rules are written here in full, and the same rules are checked by our tests.
| Part | The rule | Example |
|---|---|---|
| A line | Everything between two line breaks. A Windows line break counts once | Each item of a list |
| Number as | The number, then a dot and a space, a bracket and a space, a colon and a space, or a tab | 1. a, 1) a, 1: a, 1, a tab, a |
| Start at | The first number: 1, 0, 10 or 100. Each numbered line adds one | Start at 100: 100, 101 |
| Don't number empty lines | On at first: lines with nothing in them, or only spaces, keep no number and don't use one up | a, b, empty, c gives 1, 2, empty, 3 |
| Empty lines numbered | With the box unticked, an empty line gets its number and mark, followed by nothing | 3. on its own |
| Widths | Numbers are written as they are, without zeros in front, so line 10 is one character wider than line 9 | 9. a, then 10. b |
| The line itself | Copied exactly after the number, spaces and all | indented becomes 1. indented |
The count in the note is the number of lines that got a number. Nothing in the lines is changed, and no line is added or taken away.
Real results from our tests
We tested Add Line Numbers with headless Chromium 148, the open-source browser Chrome is built on, on a Windows laptop with an Intel Core i7-1185G7 and 32 GB of memory, on 1 November 2026. Other work was running on the laptop at the same time, so times vary from run to run: each time below is the middle one of 3 runs.
Numbering is quick. It took 17 milliseconds or less to number the lines of 500,000 characters of English, Hindi or a mix of English, Hindi, Tamil and emoji, with empty lines skipped, the most the page takes at once.
After a text is put in the box, the page waits 0.15 second before it works, so a burst of typing is worked on once, and 0.4 second when the text has more than 400,000 characters. So the result of 500,000 characters of English showed between 0.89 and 1.04 second after it was put in the box in our test. A result of more than 100,000 characters shows only its first 100,000 in the box, and says so, because showing a very long text is slow for the browser; Copy and Download take all of it.
Checked against a second program. We numbered the lines of 1,500 random texts with this page's code and again with a separate Python program, in the 1. format with empty lines skipped: the results were the same every time. The texts had English words, punctuation, empty lines and lines of spaces. Every example on this page is also one of our tests, run on the page's own code.
Size and offline. On a first visit the page downloads about 0.1 MB for the tool: the page, its styles, its scripts and the fonts, with Google's ad code not counted. In our test we switched the network off after the page had loaded and pressed Try a sample: the result showed 0.2 seconds later or less in each of 15 runs.
Phone-sized screen. We also ran the tests on a phone-sized screen in headless Chromium (390 × 844 pixels, with touch). That is not a real phone. Every button, box and tick box was 44 pixels high or more, and the page did not scroll sideways. These tests don't cover Safari or Firefox.
Try it yourself: press "Try a sample" at the top of this page. It puts a four-line to-do list in the box, with an empty line in it. The result is numbered 1, 2 and 3, the empty line is left without a number, and the page says 3 lines numbered. Then choose 1) Line.
Try the sampleChoosing a format
Each format suits a different place:
1. Lineis the usual numbered list, for emails, documents and forms.1) Lineis common in exam papers and in lists inside a sentence.1: Linereads like a reference, as in a script, a log or a list of rules.1then a tab is for spreadsheets: paste the result into a sheet and the numbers go in one column and the lines in the next. A tab also lines the text up in some editors.
Where to start. Start at 0 when a list counts from zero, as some programming does. Start at 10 or 100 to continue a list that was numbered in parts, or to give room to add lines later, as old programs did with line numbers 10, 20, 30. The numbers then go up by one each line: 100, 101, 102.
Pasting into Word or Google Docs. The numbers are plain text, so the program doesn't treat them as its own numbered list. If you want an automatic list there, use the program's own numbering instead; if you want numbers that never change, plain text numbers are the safer choice.
Empty lines and paragraphs
Don't number empty lines is ticked at first, because most lists use empty lines only to make room. The empty line stays where it is, without a number, and the next line gets the next number: the sample's to-do list goes 1, 2, empty line, 3.
A line that holds only spaces counts as empty too, so a stray space doesn't make a numbered blank line.
Untick the box when every line must have a number, for example for code or a log, where people refer to line numbers and the empty lines count. Then each empty line gets its own number and mark, and the count in the note includes it.
For paragraphs, number them as lines: put each paragraph on one line first with Remove Line Breaks, keeping blank lines between paragraphs, and then number the result with empty lines skipped.
Everyday uses
- Number a list after sorting it. Put it in order with Sort Lines, then number it here.
- Number a clean list. Take out repeated lines with Remove Duplicate Lines first, so no item gets two numbers.
- A documents list for an application: one document to a line, numbered, pasted into the covering email.
- Lines of code in a message, so that a question can name the line.
- A table in a spreadsheet: choose the tab format and paste the result into a sheet.
Opening a text file
Choose Open a text file, or drop a file anywhere on the page, and the tool reads it on your device. These files open: .txt, .md, .csv, .tsv, .log, .json, .xml, .srt, .vtt, .html and other plain-text files, with up to 500,000 characters. The file's name and size appear below the box with an x; press the x to remove the file's text. The file is read on your device and never uploaded. The result can be copied, or saved as a new text file; the file you opened is never changed.
- Letters. A file saved as UTF-8 (a byte order mark at the start is dropped) or as UTF-16 with a mark is read correctly, Hindi and Tamil included. A file that is not valid UTF-8 is read as Windows-1252, and the page says so: "This file isn't saved as UTF-8, so it was read as Windows-1252. If letters look wrong, save it as UTF-8 and add it again."
- Windows line breaks. A Windows file stores each line break as two characters. The tool reads the pair as one line break, so the lines of a Windows file are numbered like any other, with one line feed between them.
- Several files. Only the first one opens, and the page says so, for example "Opening a.txt only. Open the others one at a time."
- Not a text file. A Word, PDF or picture file renamed to .txt is not read, and the page says it doesn't look like a text file. A file named .docx, .pdf or .rtf gets this message: "Only text files (.txt and similar) can be opened here. For a Word or PDF file, copy its text and paste it into the box."
- Empty or too long. An empty file says it is empty. A file with more than 500,000 characters is not opened, and the page says how many characters it has.
For a Word or PDF file, open it in the program you normally use, select the text, copy it, and paste it into the box. A PDF whose pages are scans holds pictures, not text, so there is nothing to copy.
Private: your text stays on your device
Your text never leaves your device. The tool runs inside your browser and has no upload step: it never sends the text you type, paste or open anywhere, and it keeps no copy of it, so closing the page forgets it. The page's Content Security Policy lets it contact only this site and Google's ad service, which pays for the site; our code never gives your text to the ad code. You can check it yourself in your browser's network panel (F12 on a computer): numbering the lines adds no request that carries your text. The site's menu does remember the last few tools you opened, on your device.
Numbered lists are often personal: the questions of an exam answer, a list of documents for an application, minutes of a meeting or a script. This tool lets you number them without handing them over. Our privacy policy says what we collect, and How we prove it shows how you can check our claims yourself.
Once the page has loaded, it also works with the internet switched off. In our test we switched the network off after the page had loaded and pressed Try a sample, and the result showed 0.2 seconds later or less in each of 15 runs.
Long texts
The tool takes up to 500,000 characters at once, about 500 KB of English text. What happens when a text is longer:
- A paste that would go over the limit is not added. This holds for Ctrl+V, for press and hold, and for the Paste button. The page says, for example: "That text is very long (550,000 characters), so it was not added. The box can hold 500,000 characters. Split it into smaller parts for faster results."
- A file with too many characters is not opened. The page says, for example: "long.txt has 550,000 characters, more than the 500,000 counted at once. Split it into smaller parts for faster results."
- A text that gets in some other way stays, unchanged. If text is dragged into the box, for example, it stays there, the result stays empty and the note says: "This text is very long (550,000 characters). Split it into smaller parts for faster results."
Numbering is quick. In our tests it took 17 milliseconds or less to number the lines of 500,000 characters of English, Hindi or a mix of English, Hindi, Tamil and emoji, with empty lines skipped. The slow part is the browser showing a very long text in a box, so a result of more than 100,000 characters shows only its first 100,000, without cutting an emoji in half, and the note says so, for example "Showing the first 100,000 of 164,999 characters. Copy and Download take all of it." Copy and Download always take the whole result.
Tips
- One item to a line. If an item runs over two lines, join them first, or it gets two numbers.
- Tidy first. Remove Extra Spaces takes out stray spaces at the start of lines, which would show after the number.
- Use the tab format for a spreadsheet, and the dot format for text.
- Untick Don't number empty lines for code and logs, where every line counts.
- Number last: sort, remove repeats and tidy first, then add the numbers.
- Keep your own copy. The page forgets everything when you close it.
Limits
- Numbers only. It writes 1, 2, 3, not letters (a, b, c) or Roman numerals (i, ii, iii). For Roman numerals of single numbers, see Roman Numeral Converter.
- Four starting points: 1, 0, 10 and 100.
- No padding. Numbers aren't padded with zeros, so 9 and 10 have different widths.
- No removing. It doesn't take numbers off a list that already has them.
- 500,000 characters at once, about 500 KB of English text.
- Text only. It doesn't open Word or PDF files: copy their text first.
Terms explained
- Line number
- The place of a line in a text, counted from the top.
- Numbered list
- A list with a number in front of each item.
- Tab
- The character the Tab key types. A spreadsheet reads it as the edge between two cells.
- Empty line
- A line with nothing in it, or only spaces.
- Plain text
- Text without formatting, which looks the same wherever it is pasted.