Add Line Numbers to Text prefixes every logical line of pasted text with a sequential integer — including empty and whitespace-only lines — using a starting value from 0 to 999999, a literal separator of up to 20 Unicode characters, and optional leading-zero padding aligned to the final number's digit width. The transformation runs entirely in the browser, accepts up to one million characters, recognizes CRLF, CR, and LF line endings, normalizes the output to LF, and exposes the result as a UTF-8 plain-text file download with no byte-order mark. Every option in this cheat sheet maps directly to a control on the Add Line Numbers to Text page so you can match the setting to the file you are about to produce, whether the destination is a transcript, a code-review reference, a script draft, or a classroom handout. The same numbered output also plays well alongside a separate Line Counter pass when you need only the totals rather than a transformed file.

add line numbers to text cheat sheet
Add Line Numbers to Text: Cheat Sheet for Settings and Output

What the Cheat Sheet Covers

This is a one-page reference for the six decisions the tool asks you to make: where the text comes from, what counts as a line, what number to start at, what separator sits between number and text, whether to pad with leading zeros, and what to do with the result. Each decision has one or two correct answers and a handful of edge cases worth knowing. Keep this cheat sheet beside the page so you can set the controls in the right order without re-reading the documentation.

The tool does not perform any of the things a full word processor does. It does not count only non-empty lines, it does not renumber an existing list intelligently, and it does not add page numbers or interpret the separator as a regex pattern. If your workflow needs those behaviors, you will need a different utility — for example, Add Prefix and Suffix to Lines for arbitrary surrounding text, or the Line Counter linked above for non-transforming counts.

Settings at a Glance

ControlAccepted valueDefault behavior
Input textUp to 1,000,000 charactersEmpty input produces a visible error
Starting numberWhole non-negative integer, 0–999999Invalid values produce a visible error
SeparatorLiteral string, up to 20 Unicode charactersInserted exactly between number and original line
Leading-zero paddingOn or offWidth set by the digit count of the final generated number
Output fileUTF-8 plain text, no BOMLine endings normalized to LF
Processing locationLocal browser onlyNo text is uploaded

Editing any option after a result has been generated clears the old result and revokes its object URL. That guard exists so the preview and the download can never disagree — a stale download cannot be mistaken for current output.

How to Number Every Line of Pasted Text

  1. Paste or type the text containing the lines you want to number into the input area. The text stays in your browser; nothing is sent to a server.
  2. Choose the starting number — a whole non-negative integer from 0 to 999999. Use 1 for conventional prose, 0 for zero-indexed code references, and a higher value when you are appending to an existing list.
  3. Set the separator. Common choices are a period and a space, a colon, a vertical bar, or a tab you paste from another document. The separator is a literal string; it is never treated as a regular expression.
  4. Decide whether to pad numbers with leading zeros. When padding is on, the width is taken from the final generated number, so a short list stays short and a long list aligns naturally.
  5. Select "Add line numbers" to produce the exact LF-normalized result. Inspect the preview, which uses preformatted wrapping so spaces and line breaks remain visible without injecting extra newline characters into the download.
  6. Download the result as a UTF-8 plain-text file. The file contains no byte-order mark and uses a single LF character between every output line.

Separator and Padding Cheat Sheet

Pattern you wantStarting numberSeparatorPaddingResult shape
Conventional prose list1. (period and space)Off1. First line
Code-review reference1: (colon)Off10: def handler(...)
Tab-separated column1TAB character pasted from your editorOff7\tfunction go()
Zero-indexed array slot0. (period and space)Off0. element
Aligned review notes, three lines8. (period and space)On08. / 09. / 10.
Numbered transcript with no separator1(empty)Off1First line
Wide aligned run, 1–9 lines1. (period and space)On1. / 2. / ... / 9. (stays one digit)

The width rule is the part that surprises most people. Padding is keyed to the last number, not to a fixed digit count you choose. The tool's documented example: starting at 8 across three lines renders as 08, 09, and 10, because the final number is 10 and therefore two digits wide. Starting at 1 across nine lines renders ordinary one-digit numbers, because the final value is 9 and the width is 1. Turning padding off lets every number render at its natural width, which is the right choice for long files where alignment is not important.

Line Ending and Empty Line Behavior

The tool recognizes carriage-return plus line-feed, lone carriage return, and lone line-feed boundaries, and the output uses LF only. If you paste text copied from Notepad on Windows, from a classic Mac file, or from a Unix server, the line count stays consistent. A trailing newline at the end of your input creates a final empty logical line, and that line is numbered — so the output continues to represent the original line structure exactly. Whitespace-only lines are also numbered; the tool does not silently discard them, trim line content, collapse repeated spaces, or reinterpret tabs.

Because every logical line is numbered, the positional relationship between numbers and the original line sequence is preserved. If the input contains alpha, a blank line, and beta, the output contains three numbered lines. That explicit rule is what makes the result safe to drop into a code-review document or a legal working copy where reviewers may need to refer to specific lines by number.

Limits, Errors, and Edge Cases

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 six-digit limit applies only to user input validation, so the tool does not silently wrap, reset, or truncate the sequence mid-file. Numbers are rendered in ordinary base-ten digits without locale separators, so a German or French user gets the same 1234 that an English-speaking user does.

The separator is limited to 20 Unicode characters and is inserted literally. Separator characters are not escaped or interpreted as regular expressions, which means you can paste a tab, an arrow, or any punctuation without worrying about backslashes. Empty input, an invalid starting number, or a separator longer than 20 characters each produce a visible error instead of output, so a wrong control never produces a silently broken file. Input length is bounded to keep browser work responsive and memory use predictable; the supported ceiling is one million characters.

The output is plain UTF-8 text. Rich formatting, syntax highlighting, spreadsheet columns, and document-file structures are outside the scope of this tool — it produces a numbered plain-text copy you can paste anywhere that accepts text, including chat, email, and version-control diffs.

When to Reach for a Different Tool

Use this cheat sheet when you want a stable, predictable numbered copy that preserves blanks and runs locally. For counting lines without transforming them, use the Line Counter. For surrounding each line with arbitrary literal text rather than a sequential integer, use Add Prefix and Suffix to Lines. For comparing two versions of a numbered document line by line, the Text Diff tool pairs naturally with this one. Each of those tools keeps the same local-only, browser-based processing model, so the workflow stays private from end to end.

Related reading: Add a Prefix to Each Line on Android in Your Browser.

Related reading: Add Quotes to All Lines in Notepad++: The Paste-Back Fix.