Text tools

Add line numbers to text

Number each line of pasted text or a UTF-8 file. Pick the first number, the step and the format, then copy or download the numbered text. The rest of each line stays as it was. It runs in your browser.

Processed in your browser

Numbering options

Each included line becomes Prefix + number + Separator + original text. Start and Increment accept signed whole decimal numbers; zero or negative increments are allowed.

Choose your options, then number lines.

Editor text uses LF line endings. Downloads use UTF-8.

Result

Your result will appear here.

How to add line numbers to text

  1. Set the numbering

    Type the Start number and the Increment. Add a Prefix, change the Separator or raise Minimum digits for leading zeros.

  2. Add your text

    Paste text into Input text or select Open UTF-8 file, then select Number lines.

  3. Save the result

    Select Copy or Download .txt. Use as input moves the result back into the editor for another pass.

What the numbered text looks like

With the default options, each line gets its number, a dot and a space. The Example text Apples, Café, Tea, a blank line and an indented line becomes 1. Apples, 2. Café, 3. Tea, 4. on the blank line and 5. before the indented line. Clear Number blank lines and the blank line stays empty, so the indented line gets 4.

Set Prefix to Line and a space, and Separator to a colon and a space, to get Line 1: Apples. Set Minimum digits to 3 to get 001. Apples. Start 10 with Increment 10 gives 10, 20, 30, and a negative Increment counts down.

Questions

How do I add line numbers to text?

Paste the text into Input text and select Number lines. With the default options every line starts with 1., 2., 3. and so on. Select Copy to paste the numbered text somewhere else, or Download .txt to save it as numbered-lines.txt.

Can I start from another number or count by twos?

Yes. Start number sets the first number and Increment sets the step between lines. Both take whole numbers with an optional + or - sign, so Start 0 and Increment 2 both work, and Increment 0 gives every line the same number.

Will blank lines be numbered?

Yes, by default. A blank line is empty or contains only ASCII spaces and tabs. Uncheck Number blank lines to leave these lines unchanged without advancing the number. A final line ending does not create an extra line. Empty input produces empty output.

Are large numbers exact? How does padding work?

Start and Increment use exact integer arithmetic, including values beyond JavaScript’s safe Number range. Enter decimal digits with an optional + or − sign (use the keyboard hyphen for minus), not fractions or exponent notation. Surrounding whitespace is ignored. Minimum digits adds leading zeros, excluding the minus sign: −2 with three digits becomes -002. Numbers are never truncated. Use Prefix and Separator for literal text around each number; the default separator is a dot and a space.

What happens to my text and line endings?

Letters, Unicode, emoji, combining marks and whitespace remain intact. Lines are separated by CRLF, LF, CR, Unicode line separator or paragraph separator. UTF-8 file downloads preserve each ending and a leading BOM before the first number. File names and MIME types do not restrict valid UTF-8 input; malformed UTF-8 gives an error. The file preview and Result show all of these endings as line breaks. Editing a file preview or using the result as input switches to LF line endings. Copy and Download .txt keep the original endings until you edit the input; clipboard applications may also adapt endings. Downloads are plain UTF-8 text.

Is my text private? Can I cancel?

Processing and file decoding run in your browser. Text and file names are not uploaded, logged or saved in browser storage. Cancel stops processing and keeps your input; Reset clears input, results and settings. There is no fixed text-length or digit-length cap. Padding must be a positive whole safe integer; actual browser number, string and memory capacity still applies, and failures are reported. Very large editor previews can be less responsive.