Output appears here
Paste text and click Add Line Numbers// add line numbers to any text in one click
Add line numbers to any text or code instantly. Choose start number, separator style, and padding. Free browser-based tool, no sign-up required.
Output appears here
Paste text and click Add Line NumbersPaste any text, code, log, or list into the input field on the left.
Set start number, step increment, separator style, and optional zero-padding.
Click "Add Line Numbers", then copy the result or download it as a .txt file.
Line Numbering is a free browser-based tool that adds sequential numbers to the beginning of each line in any text or code block. Configure the start number, step, separator style, and zero-padding to match your exact formatting needs β then copy or download the result instantly.
Yes. Use the START field to set any starting number, including 0. This is useful when continuing a numbered sequence from a previous section or document.
The STEP option controls the increment between line numbers. For example, a step of 5 produces 5, 10, 15, 20... β useful for scripting languages like BASIC or for creating numbered outlines with room to insert lines later.
Zero-padding ensures all line numbers have the same width by prepending zeros (e.g., 001, 002, 010). This is useful for sorting, log files, or any context where consistent column alignment matters.
When this option is enabled, blank lines are preserved in the output but are not assigned a line number. Only non-empty lines receive numbers. This is helpful for keeping paragraph spacing without disrupting the numbering sequence.
The processing is done entirely in your browser via a local API call β your text is never stored or logged on any external server. Everything stays on your device.
For code snippets and logs, the Dot or Colon separator is most common. For tabular alignment, use Tab. The Bracket style ([1] text) is popular in scripts and legal documents.
A line numbering tool adds sequential numbers to the beginning of each line in a block of text. While many code editors include this feature natively, there are countless situations where you need to add line numbers to plain text outside of an IDE β for documents, logs, scripts, presentations, or content that will be copied into another system. This free online tool lets you do exactly that, with full control over the formatting.
Line numbers serve many practical purposes. In technical writing and documentation, they allow authors and reviewers to reference specific lines by number β a standard practice in code reviews, legal contracts, and academic manuscripts. In log analysis and debugging, line-numbered output makes it far easier to correlate entries with error messages that reference a specific line. In scripting and content planning, numbered lines help maintain structure and allow collaborators to point to a specific location without ambiguity.
Even in everyday tasks like creating interview question sheets, survey templates, exam papers, or step-by-step instructions, numbered lines give content a professional, organized appearance. The visual cue of a number at the start of each line reduces cognitive load for readers scanning a long document.
The separator between the line number and the line content has a significant impact on readability and compatibility with downstream tools. Here is a breakdown of the six available options:
1. text) β The most familiar style, matching the default format of ordered lists in Markdown and word processors. Best for general-purpose documents and readable prose.1: text) β Common in log files, error outputs, and compiler messages. Clean and compact.1 | text) β Visually distinct; useful when the content itself contains dots or colons and you want a separator that doesn't blend in.[1] text) β A popular convention in scripts, legal documents, and technical specifications. The brackets clearly delimit the number from the content.1β₯text) β Uses a tab character for separation, ideal for output that will be pasted into a spreadsheet or parsed by a tab-separated values (TSV) reader.1 text) β Two spaces for a minimal, clean look. Best when you want the number present but visually unobtrusive.When working with files that have more than nine lines, simple sequential numbers like 1, 2, 3... cause column misalignment β the single-digit numbers are shorter than double- or triple-digit numbers. Zero-padding solves this by automatically detecting the width of the largest line number and prepending zeros to shorter numbers. For a 100-line file starting at 1, the output becomes 001, 002, 003... 010, 011... 100, ensuring every line starts at exactly the same horizontal position.
This is especially important in log files, shell scripts, and any context where monospace alignment is expected. Sorted file listings, database exports, and batch processing outputs all benefit from zero-padded line numbers.
The default behavior is to start at 1 and increment by 1, but many workflows require different settings. Starting at 0 is standard in many programming contexts. Starting at 10 or 100 leaves room to insert lines before the first item. A step of 5 or 10 is a classic technique from BASIC programming and was used precisely to allow new lines to be inserted between existing ones without renumbering everything.
For legal documents, a step of 5 β producing lines numbered 5, 10, 15, 20 β is sometimes required by court formatting rules. For outlines and structured documents, a step of 10 gives breathing room for future additions. This tool supports any combination of start and step values, giving you complete control over the numbering scheme.
In many documents, blank lines serve as paragraph or section dividers. If you number every line including blanks, the numbering sequence becomes interrupted by unnumbered gaps β or worse, the blank lines consume sequence numbers, throwing off references. The "Skip empty lines" option preserves blank lines in the output but does not assign them a number, so only content-bearing lines are counted. This is ideal for formatted prose, poetry, song lyrics, and structured documents where blank lines convey meaning.
Code editors like VS Code, Sublime Text, and Vim display line numbers in the gutter β but these numbers are a UI feature, not part of the text. When you copy code from an editor, the line numbers are not included. This tool solves that problem by permanently embedding the line numbers into the text itself, so the numbered output can be pasted into emails, chat messages, documents, or any plain-text field and retain its numbering.
This is a common need during code reviews, when you want to paste a snippet with visible line numbers for teammates to reference. It is also essential when generating content for PDF or print output, where the editor's gutter is never rendered.
All processing happens locally in your browser. Your text is submitted to a local PHP API endpoint on the same server and is never logged, stored, or transmitted to any third party. The tool works entirely offline once the page is loaded and does not require any account, sign-up, or installation. It is completely free to use with no usage limits.