Add Line Numbers to Text is a browser-based tool that prefixes every line of pasted text with a sequential integer — and because it runs entirely in the client and uploads nothing, it serves as a practical alternative to Word's built-in line numbering, the gutter in your code editor, or any manual counting workflow. The tool accepts up to 1,000,000 characters, lets you pick the starting number (from 0 to 999999), choose a separator of up to 20 Unicode characters, and pad numbers with leading zeros aligned to the final sequence value. After you press the button, the preview shows exactly what the downloaded file will contain — a UTF-8 plain-text document using single LF characters between every line, regardless of whether your input used Windows CRLF, classic Mac CR, or Unix LF endings. Every logical line is numbered, including blank lines and lines that contain only whitespace, so the position of every line stays anchored to its number. Editing any option clears the old result and revokes its download URL, so you cannot accidentally save stale output.

Why Choose a Browser Tool Over Word or a Code Editor
Word's line numbering is useful inside a document but does not travel: when you copy a numbered passage into an email, a chat, or a markdown file, the numbers disappear with the formatting. A code editor's gutter is great for code but only renders on screen — it is not part of the copied text, and producing line-numbered output usually means a special command, extension, or copy-with-line-numbers plugin. Add Line Numbers to Text sidesteps both problems by transforming the actual text, so every line in the output is preceded by its number, and you can paste that result into any chat, email, transcript editor, or markdown document and the numbers travel with the text.
Three properties make this approach genuinely different from the alternatives. First, the output is portable: it is plain UTF-8 with no byte-order mark, so it opens identically in Notepad, TextEdit, vim, VS Code, or any other editor. Second, the numbering is configurable in ways Word and IDEs are not: you can start at any whole number from 0 to 999999, set a custom separator up to 20 characters, and pad with leading zeros that automatically align to the final sequence value. Third, the transformation runs locally — no upload, no account, no server round trip — so it is reasonable to use on transcripts, support logs, or any text you would not paste into a third-party service.
If your primary goal is Word's document-level numbering rather than a portable artifact, the Word and plain-text line numbering guide walks through that approach in detail. For plain-text workflows — transcripts, code reviews outside your IDE, scripts intended to share — the browser approach tends to be faster because the numbered text is itself the artifact.
Input Limits and What the Tool Actually Accepts
Before you paste anything, a few hard limits and behaviors are worth knowing. The transformation is deliberately bounded so that the browser stays responsive even on long pastes.
| Option | Accepted values | Notes |
|---|---|---|
| Input text | Up to 1,000,000 characters | Longer input is rejected with a visible error. |
| Starting number | Whole non-negative integer, 0 to 999999 | Six-digit maximum for input validation only; later values can exceed six digits. |
| Separator | 0 to 20 Unicode characters | Can include spaces, punctuation, a tab, or be empty; not treated as a regex. |
| Zero-padding width | Width of the last number in the result | Disabled renders each number at its natural width. |
| Line endings | CRLF, CR, or LF accepted | Output always uses LF between lines. |
| Blank lines | Numbered as logical lines | Empty and whitespace-only lines receive the next number. |
Two of these deserve extra attention. The separator rule means you can use a literal period and space, a colon, a vertical bar, a tab character pasted from your clipboard, or even an empty separator for tight numbering like "1alpha". The padding rule means the tool does not silently wrap or truncate the sequence if your final number has more digits than six — instead, the later numbers print at their natural width. If you supply an invalid starting number, an empty input, or a separator longer than 20 characters, the tool surfaces a visible error instead of producing output. This is by design: it prevents guessing and keeps the downloaded file from containing a quietly mangled sequence.
How to Add Line Numbers to Text in Three Steps
Three steps cover the typical workflow. Each step is explicit about what to do and what to expect, so the same routine works whether you are numbering a 10-line transcript or a 200,000-character log file.
- Paste or type the text whose lines you want to number into the input area. The tool accepts up to 1,000,000 characters and recognizes CRLF, CR, and LF line endings, so you can paste from Notepad, TextEdit, a terminal, or a code editor without preprocessing.
- Choose the starting number, the separator, and whether to pad numbers with leading zeros. The starting number must be a whole non-negative integer from 0 to 999999, the separator must be no longer than 20 Unicode characters, and padding width is set automatically from the last number in the result.
- Select Add line numbers to generate the result. Inspect the preview to confirm the exact text, then download the UTF-8 TXT file. Editing any option after generating clears the old result and revokes its download URL, so the file you save always matches the current preview.
If your input ends with a newline, the tool creates a final empty logical line and numbers it. This preserves the original line structure in the output. If your input mixes line-ending styles inside the same paste, every line — including the ones that originally used CRLF or lone CR — is split consistently and the preview shows the LF-normalized form.
Picking a Separator and Padding Width That Work
The right separator depends on where the numbered text will end up. For code-review comments in a chat or pull-request description, a tab between the number and the line keeps the original code intact and aligns numbers in monospaced fonts. For prose — interview transcripts, witness statements, classroom material — a period and a single space reads naturally and matches what most editors would type by hand. For scripts or poetry, a vertical bar separates the number from the line without adding a period that the reader might mistake for the end of a sentence. An empty separator works when you want the number to sit flush against the line content, which is the right choice for source-code dumps where every character matters.
Padding is the other decision that affects readability. The rule is mechanical: the tool measures the digit count of the final sequence value, and that becomes the padding width. Suppose you start at 5 and have 12 lines. The last number is 5 + 12 − 1 = 16. Sixteen has two digits, so the width is 2, and the output begins with "05", "06", "07", and continues through "16". Starting at 0 with nine lines gives single-digit numbers because the final value is 8, so padding either matches that one-digit width or stays off. Starting at 0 with 1,000 lines produces "000" through "999" with width 3. Turning padding off renders each number at its natural width — useful when alignment does not matter and you would rather not see leading zeros.
Padding only affects the generated numeric prefix. The original line text is never modified, trimmed, reflowed, or collapsed, so a leading space in your input still appears after the separator in the output, and a trailing space is preserved too.
When Numbered Lines Actually Save Time
Several recurring workflows benefit more from numbered plain text than from Word's document-level numbering or the gutter in an IDE.
- Code-review references outside the editor: when you need to point a teammate at line 142 of a pasted log or transcript, a portable numbered file beats a screenshot of the editor.
- Transcripts and interview records: numbering each line makes it easy to quote, cite, or jump to a specific moment later.
- Poetry and script drafts: a numbered copy gives a stable identifier you can reference in notes without reloading the file.
- Support logs and incident write-ups: line numbers let readers and reviewers cross-reference specific entries during discussion.
- Legal-review working copies and classroom material: numbering adds accountability without forcing a particular document format on the recipient.
The common factor is that the line number has to travel with the text, not stay locked inside the editor that produced it. That is exactly the gap a browser tool that ships a plain-text artifact closes.
What Add Line Numbers to Text Doesn't Do
Because the tool is deliberately narrow, knowing its boundaries avoids misusing it. It does not count only non-empty lines — every logical line, blank or not, receives a number, so the position of a meaningful line never shifts because a blank line happened to precede it. It does not preserve the original newline bytes in the output; mixed CRLF, CR, and LF input is normalized to LF so the file is portable across editors. It does not renumber an existing numbered list intelligently: the tool prefixes every line regardless of whether the line already starts with a digit, so "1. first" becomes "1 1. first" with a space separator. It does not add page numbers, and it does not generate a Word document, a PDF, or any formatted output — the artifact is plain UTF-8 text.
For counting lines without transforming them, the Line Counter reports total, non-blank, and blank lines plus the longest line. For wrapping each line with arbitrary text — a quote, a code fence, a JSON bracket — use Add Prefix and Suffix to Lines. For converting or removing the line breaks themselves, the Line Break Converter and the Line Break Remover handle that without touching the line content. Each of those tools is shaped to one specific job, and Add Line Numbers to Text is shaped to one job too: turning pasted text into a numbered, portable plain-text file.