Add Line Numbers
Put a number in front of every line, starting wherever you like, or remove numbering that came along with pasted text.
How to add line numbers to text online
Most text editors do not number lines when you copy from them, and plain text boxes on websites never do. If you need numbers that travel with the text, such as in an email, a forum post, a Word document or a printed handout, you have to add them as real characters. Paste your text here and every line gets a number in front of it.
Useful starting points: a start value of 1 for ordinary lists, 0 for programmers who count from zero, or any other number when you are quoting a part of a longer text. If you are quoting lines 40–55 of a poem or a contract, set the start value to 40 and the numbers will match the original.
Numbering your lines
- Put your lines in the box, one per line. Code, lyrics, a script or a plain to-do list all work.
- Leave Action on Add line numbers, pick the number to start from, and choose a separator: a dot, a bracket, a colon, a dash, a pipe, a tab or just a space.
- Tick Pad with zeros if you want numbers of equal width (01, 02 … 10), and Number blank lines too if empty lines should use up a number.
- Copy the numbered text or download it. To go the other way, switch Action to Remove line numbers.
Pick a separator that suits your use
| Separator | Output | Good for |
|---|---|---|
| Dot | 1. First line | Numbered lists, steps, instructions |
| Bracket | 1) First line | Formal lists and exam answers |
| Colon | 1: First line | Transcripts, subtitles, references |
| Dash | 1 - First line | Lyrics, readable plain-text lists |
| Pipe | 1 | First line | Code listings, log files |
| Tab | 1 [tab] First line | Pasting into spreadsheets so numbers fall into their own column |
| Space | 1 First line | Simple, compact numbering |
Zero padding and blank lines
When a list goes past nine lines, the text shifts sideways because “10” has two digits while “9” has one. Zero padding fixes that by writing 01, 02, 03 and so on, so every number takes the same width and the text lines up. The padding adapts to the length of your list: a list of 120 lines is padded to three digits (001 to 120).
Blank lines are skipped by default. They stay in your text but are not numbered, so the numbers run 1, 2, 3 with no gaps even when paragraphs are separated by empty lines. Tick Number blank lines too when you want the number to match the actual line position, which matters for code, logs and legal documents where a line reference must point to an exact line.
Remove line numbers from text
Copying from a code listing, a PDF or an old email often brings the line numbers along. Choose Remove line numbers and the tool removes a number at the start of each line, along with the dot, bracket, colon, dash, pipe, tab or space that follows it. The remaining text is left exactly as it was.
This works best when every line starts with a number. If only some lines are numbered, check the result and fix any that were missed. A line that begins with a real number that is part of the content, like “2024 was a good year”, will lose its first word, so do not use the removal on text that has such lines.
Where numbered lines help
- Pointing to an exact line in code, a contract clause, a poem or a script during a review.
- Turning a plain list of tasks or steps into a numbered list without retyping.
- Making a transcript or subtitle draft easy to discuss by line.
- Preparing a quiz, a ranking or a top-ten list for a newsletter or post.
- Giving each row of exported data an ID before pasting it into a spreadsheet.
Numbering questions
How do I add numbers to the start of every line?
Paste the text, keep the action on Add line numbers, choose a separator and copy the result. Each non-empty line gets a number.
Can I start numbering at 0 or at a different number?
Yes. Change the Start at value to any whole number, including 0 and negative numbers.
Can I use the numbered text in Excel or Google Sheets?
Yes. Choose the tab separator and paste. The numbers fall into the first column and the text into the second.
Are empty lines counted?
Not by default. Empty lines are left in place without a number. Tick Number blank lines too to number every line.
How do I remove numbers from a numbered list?
Change Action to Remove line numbers. It strips the number and the separator after it from the start of each line.
Handy with line numbers
Number a list after it is in order: sort the lines first, and remove duplicates so the numbering is meaningful. If pasted text brought its own numbers, you can also strip them with find and replace, and the word counter tells you how long the numbered text ended up.