Add line numbers to any text

Paste a text and each line gets a number at its start, in your browser: nothing you type is uploaded.

  • Nothing uploaded
  • As you type
  • Any language
  • Free, no sign-up

Getting ready…

Quick facts from our tests

Check it yourself: once the page has loaded, turn off Wi-Fi and mobile data, and Add Line Numbers still works. Your browser's network panel (F12 on a computer) lists every request the page makes: you'll see Google's ad requests, and none of them carries your text. Our code never gives your text to the ad code. How we prove it

How to number lines

  1. Paste the text

    Or open a text file.

  2. Pick the style

    1. or 1) or a tab.

  3. Copy the result

    Or download it.

When this tool isn't the right fit

  • You need letters (a, b, c) or Roman numerals (i, ii, iii) in front of the lines. This tool writes numbers only: 1, 2, 3.
  • You want an automatic list in Word or Google Docs. The numbers here are plain text. Use the program's own numbering for a list that renumbers itself.
  • You need to take numbers off a list. This tool only adds them. Find and Replace with a regular expression can remove numbers at the start of lines.

Why use PDFGuild's line numberer

More free tools

Private like this one: nothing you type or add leaves your device.

Add Line Numbers: the complete guide

Four ways to number, where to start, empty lines, lists, code and scripts, real results and tips.

In this guide
  1. What it does
  2. Step by step
  3. How lines are numbered
  4. Real results
  5. Choosing a format
  6. Empty lines
  7. Everyday uses
  8. Opening a file
  9. Privacy
  10. Long texts
  11. Tips
  12. Limits
  13. Terms explained

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:

  1. 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.
  2. Pick how the number is written under Number as: 1. Line, 1) Line, 1 then a tab or 1: Line.
  3. Pick where to start under Start at: 1, 0, 10 or 100.
  4. Leave Don't number empty lines ticked to skip blank lines, or untick it to number every line.
  5. 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.

PartThe ruleExample
A lineEverything between two line breaks. A Windows line break counts onceEach item of a list
Number asThe number, then a dot and a space, a bracket and a space, a colon and a space, or a tab1. a, 1) a, 1: a, 1, a tab, a
Start atThe first number: 1, 0, 10 or 100. Each numbered line adds oneStart at 100: 100, 101
Don't number empty linesOn at first: lines with nothing in them, or only spaces, keep no number and don't use one upa, b, empty, c gives 1, 2, empty, 3
Empty lines numberedWith the box unticked, an empty line gets its number and mark, followed by nothing3. on its own
WidthsNumbers are written as they are, without zeros in front, so line 10 is one character wider than line 99. a, then 10. b
The line itselfCopied 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 sample

Choosing a format

Each format suits a different place:

  • 1. Line is the usual numbered list, for emails, documents and forms.
  • 1) Line is common in exam papers and in lists inside a sentence.
  • 1: Line reads like a reference, as in a script, a log or a list of rules.
  • 1 then 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.

Add Line Numbers after its sample: a short to-do list numbered 1. to 3., its empty line left without a number
Our sample list, numbered in the browser.

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.

Add Line Numbers after its sample: a short to-do list numbered 1. to 3., its empty line left without a number, at a phone's size with the internet switched off by our test, between our test's bands that read "Internet switched off" and "Nothing uploaded: 0 requests sent data"
Proof from our testOn 9 November 2026, our test opened Add Line Numbers at a phone's size, switched the internet off and ran it on its built-in sample. It finished with no connection, and none of the page's 15 requests sent any data.How we test, and how to check it yourself

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.

Frequently asked questions

How do I add numbers to each line?

Paste the text into the top box. Every line gets a number at once, in the 1. format, starting at 1. Copy the result, or download it as a text file.

Can I start at a number other than 1?

Yes. Under Start at, choose 0, 10 or 100 instead of 1. The numbers then go up by one each line.

Which formats can I choose?

Four: 1. Line, 1) Line, 1: Line, and the number followed by a tab, which pastes into a spreadsheet as two columns.

Are empty lines numbered?

Not at first: Don't number empty lines is ticked, so they stay without a number and don't use one up. Untick it to number every line, empty ones included.

How do I put the numbers in a separate column in Excel?

Choose 1 then a tab, copy the result and paste it into the sheet. The numbers go in one column and the lines in the next.

Does it number paragraphs?

It numbers lines. Put each paragraph on one line first with Remove Line Breaks, keeping blank lines between paragraphs, then number the result here.

Can it use letters or Roman numerals?

No. It writes 1, 2, 3 only.

Can it remove numbers from a list?

No. It adds numbers; it doesn't take them off. Find and Replace with a regular expression can remove numbers at the start of lines.

Does it change my text?

No. Each line is copied exactly after its number, spaces and all, and no line is added or taken away.

Does it work for Hindi and other scripts?

Yes. Lines in any script get numbers the same way, and the text of each line is not changed.

Is Add Line Numbers free?

Yes. There is no sign-up and no watermark, and you can use it as often as you like. Ads from Google help pay for the site. They are kept apart from the tool, and our code never gives them your text.

Is my text uploaded anywhere?

No. The tool has no upload step: it works inside your browser and never sends the text you type, paste or open anywhere, and it keeps no copy of it. Google's ad code is on the page, and our code never gives it your text. How we prove it shows how to check.

How much text can it take at once?

Up to 500,000 characters, about 500 KB of English text. A paste or a file that would go over is not added, and the page says so. 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. See Long texts.

Can I open a text file, or a Word or PDF file?

A text file, yes: choose Open a text file or drop a .txt, .csv or similar file on the page, with up to 500,000 characters. A Word or PDF file must have its text copied out first, because the tool reads text, not those files.

Does it work offline?

Yes, once the page has loaded. 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. If you open the page for the first time with no internet, it can't load.

By the PDFGuild team · Updated · How we test