Line Numbering Tool: Free Online Tool
FREE TOOL · NO SIGN-UP
This line numbering tool adds a number to the start of every line in your text or code. You can choose the starting number, pick a format like “1.”, “1)”, “[1]” or a tab, skip blank lines and zero-pad numbers so they line up. It is handy for code reviews, legal drafts, scripts, transcripts, poems, checklists and any document where people need to point to “line 42”. Paste your text and the numbered version appears instantly. Everything runs in your browser.
How to Use the Line Numbering Tool
Paste, set the format, copy.
Step 1: Enter or paste your input
Paste your text into the Input text box: code, a log, a contract clause, a script, a list or lyrics. Each line break starts a new line, and both Windows and Unix line endings are handled. Clear empties the box.
Step 2: Choose your options
- Start at: the first number. The default is 1, but you can start at any number, for example 101 to continue from a previous page.
- Format: how the number looks. Choose
1.,1),1:,1<tab>,[1]or1 -. - Skip empty lines (on by default): blank lines stay in place but get no number, so numbering continues on the next line with text.
- Zero-pad numbers: adds leading zeros so all numbers have the same width, like 01, 02 … 10, or 001 to 100.
Step 3: Copy, download or apply the result
The numbered text updates as you type. The stats show how many lines were numbered and the input and output character counts. Click Copy or Download to save it as a text file, then paste it into your document, ticket, email or chat.
What Line Numbering Is Used For
Line numbering means putting a sequential number at the start of each line, so anyone reading can refer to an exact spot without quoting it. “See line 14” is faster and clearer than “the bit about the payment terms, near the middle”.
Common uses:
- Code review and debugging. Error messages and stack traces point to line numbers, and reviewers comment on specific lines.
- Legal and academic documents. Pleadings, contracts, transcripts and manuscripts often use line numbers so lawyers, judges and reviewers can cite them.
- Scripts and screenplays. Rehearsals and table reads go faster when everyone can jump to the same line.
- Poetry and lyrics. Teachers and students cite lines when analysing poems.
- Checklists and instructions. Numbered steps make it easy to say which step failed.
- Data and lists. Numbering rows helps when counting items or matching them with another list.
Most code editors show line numbers on screen, but those numbers disappear when you copy the text into an email, chat, document or ticket. Adding the numbers into the text itself keeps them wherever it goes.
Custom Start Numbers, Separators and Padding
Start number. Use a custom start when you are numbering a section of a longer file, so your numbers match the original. If you copied lines 120 to 160 from a file, start at 120 and the numbers match what your editor shows.
Separators. Each format suits different jobs:
| Format | Example | Good for |
|---|---|---|
1. | 1. First line | Lists, instructions, documents |
1) | 1) First line | Outlines, quizzes |
1: | 1: First line | Logs, code excerpts |
1<tab> | 1 First line | Pasting into spreadsheets: numbers and text land in separate columns |
[1] | [1] First line | References, transcripts |
1 - | 1 – First line | Plain-text notes and chat |
Zero-padding. Without padding, “9.” and “10.” have different widths, so text after the numbers does not line up in monospace fonts. Padding adds leading zeros based on the total number of lines, giving 01 to 99 or 001 to 999. It also keeps numbered lines in the correct order if you sort them as text later.
Numbering Code Snippets and Logs
When you share code in a chat, email, issue tracker or document, numbered lines make feedback much easier. A reviewer can write “line 7 should check for null” instead of copying the line.
Tips for code:
- Match the source. Set Start at to the line where your snippet begins in the real file.
- Turn off Skip empty lines. In code, every line counts, including blank ones, so editor and compiler line numbers include them. Untick the option so your numbers match.
- Use the
1:or tab format to keep the code readable. - Remember to strip numbers before running code. Numbered code will not compile. Keep the original.
For logs, numbering helps when you discuss a long output with someone else. Combine it with the Line Counter to check total, blank and unique lines first.
If you need to format the code itself, run it through a beautifier like the JavaScript Beautifier before numbering, since reformatting after would change the line numbers.
Line Numbers in Legal Documents and Scripts
Legal documents often require line numbers. Many US court pleadings use numbered lines in the left margin, and transcripts and depositions are cited by page and line. Contracts under negotiation are easier to discuss when each line can be referenced.
For formal legal filings, use your word processor’s built-in line numbering or the court’s template, because margin numbers have to follow specific formatting rules. This tool is best for working drafts, emails to colleagues, plain-text versions and reviews where you need numbers in the text itself.
For scripts and screenplays, number dialogue lines for rehearsals, voice-over sessions and subtitling. Keep Skip empty lines on, so spacing between speeches does not use up numbers.
For poems and song lyrics, numbering helps with analysis and teaching. Keep blank lines between stanzas unnumbered so the numbers follow the lines of verse.
Key Features of Our Line Numbering Tool
- Free with no signup.
- Custom start number.
- Six number formats, including tab for spreadsheets.
- Skip empty lines option, on by default.
- Zero-padding for aligned numbers.
- Handles Windows and Unix line endings.
- Copy and Download; runs in your browser.
Who Needs Numbered Lines
- Developers and reviewers sharing code outside an editor.
- Lawyers and paralegals working on drafts and transcripts.
- Teachers and students analysing poems and texts.
- Writers and actors working with scripts.
- QA and support teams referencing log lines in tickets.
Pro Tips and Mistakes to Avoid
Checklist of best practices
- Match the start number to the original source.
- Untick Skip empty lines for code.
- Use zero-padding for more than nine lines in monospace text.
- Use the tab format to paste into a spreadsheet.
Common mistakes and quick fixes
- Numbers do not match the editor. Skip empty lines is on, or the start number is wrong. Adjust both.
- Wrapped lines look unnumbered. A long line that wraps on screen is still one line. Turn off word wrap to see it clearly.
- Need to remove numbers later. Use Find and Replace Text with regex
^\d+\.on each line, or keep the original copy. - Broken lines from PDFs. Join them first with the Line Break Remover.
Reference Any Line Instantly
Paste your text above to number every line in seconds. Count lines with the Line Counter, add text to each line with the Add Prefix / Suffix to Lines tool, and compare versions with Text Compare. See every free tool in the FHSEO Hub tools directory.
