Skip to content

Add Line Numbers to Text

Number every line of pasted text from a chosen starting value with a custom separator and optional zero padding.

Privacy: your files never leave your device. All processing happens locally in your browser.

How to use

  1. 1.Paste or type text containing the lines you want to number.
  2. 2.Choose the starting number, separator, and optional leading-zero padding.
  3. 3.Generate the result, inspect the preview, and download the UTF-8 TXT file.

About Add Line Numbers to Text

Add Line Numbers to Text prefixes every input line with a sequential integer. Paste or type up to 1,000,000 characters, choose a starting number from 0 to 999999, set a separator, and optionally pad numbers with leading zeros. Select Add line numbers to preview the exact transformed text and download it as a UTF-8 plain-text file. The transformation runs entirely in the browser and sends no text to Lizely.

Every logical line receives a number, including empty lines. If the input contains alpha, a blank line, and beta, the output contains three numbered lines. This explicit rule preserves the positional relationship between numbers and the original line sequence. The tool does not silently discard whitespace-only lines, trim line content, collapse repeated spaces, or reinterpret tabs.

Line endings from Windows, classic Mac, and Unix text are recognized. Carriage-return plus line-feed, lone carriage return, and lone line-feed boundaries are split consistently, and the preview and downloaded result use a single line-feed character between output lines. A trailing input newline creates a final empty logical line and that line is numbered, so the output continues to represent the original line structure.

The starting number must be a whole non-negative integer with at most six digits. Sequence values then increase by one for each logical line. Very long input can make later values exceed six digits; the limit applies to user input validation, not to silently wrapping or truncating the sequence. Numbers are rendered in ordinary base-ten digits without locale separators.

The separator is inserted exactly between each generated number and the untouched original line. It can contain spaces, punctuation, a tab pasted by the user, or be empty, and it is limited to 20 Unicode characters. Common choices include a period and space, a colon, a vertical bar, or a tab. Separator characters are not escaped or interpreted as regular expressions.

Leading-zero padding uses the width of the last number in the result. Starting at 8 with three lines produces 08, 09, and 10; starting at 1 with nine lines produces ordinary one-digit numbers because the final value remains one digit. Turning padding off renders each number at its natural width. Padding affects only the generated numeric prefix, never the original line text.

The tool does not modify the input area when it generates a result. Editing any option clears the old result and revokes its object URL, preventing a stale download from being mistaken for current output. The preview uses preformatted wrapping so spaces and line breaks remain inspectable while long lines can wrap visually without gaining extra newline characters in the download.

Input length is bounded to keep browser work responsive and memory use predictable. Empty input, an invalid starting number, or an overly long separator produces a visible error instead of output. The generated file is plain UTF-8 text with no byte-order mark. Rich formatting, syntax highlighting, spreadsheet columns, and document-file structures are outside the scope.

Use this tool for code-review references, transcript numbering, poetry or script drafts, support logs, legal-review working copies, classroom material, and any workflow that needs stable line identifiers. It does not count only non-empty lines, preserve mixed original newline bytes, renumber an existing numbered list intelligently, or add page numbers. For counting rather than transforming, use Line Counter; for adding arbitrary text around each line, use Add Prefix and Suffix to Lines.

Methodology & sources

Validate bounded text, a whole starting number, and a short literal separator; split CRLF, CR, and LF while retaining trailing empty lines; compute optional padding from the final sequence value; prefix every logical line including blanks; join with LF; preview the exact string; and expose it as a local UTF-8 text Blob.

Frequently asked questions

Are blank lines numbered?
Yes. Every logical line, including empty and whitespace-only lines, receives the next number.
What happens to Windows CRLF line endings?
CRLF, CR, and LF are recognized, and generated output uses LF consistently.
How is zero-padding width chosen?
Padding uses the digit width of the final generated number so the sequence aligns without truncation.
Is my text uploaded?
No. Numbering, preview generation, and TXT download creation happen locally in the browser.

Text Tools guides

View all