Input

or drop a file here, or paste code below

0 lines · 0 characters

Result

0 lines · 0 characters · 0 line(s) numbered

Files never leave your browserHow?

This tool adds line numbers to every line of a text, a list or source code. Paste the text, choose the format such as "1. " or "001: ", and copy the numbered result.

Last updated:

How it works

  1. Paste text or code

    Paste or open the text you want to quote, review or print with line numbers.

  2. Set the format

    Pick a style or write your own with {n} for the number, set where to start and the step, and choose padding.

  3. Copy the numbered text

    The numbered text updates as you change options. Copy or download it.

Features

  • Any number format

    Use presets such as "1.", "1)", "[1]" or a tab after the number, or a template like "Line {n}: ". Numbers can go at the start or at the end of each line.

  • Aligned numbers

    Pad with leading zeros (001, 010, 100) or right-align with spaces so code stays readable; the width follows the last number.

  • Skip blank lines

    Number only lines that contain text, like a numbered list, while blank lines stay blank.

  • Custom start, step and direction

    Start at any number, count in steps of 10 for BASIC-style listings, or count down.

  • Remove line numbers

    Strip numbers that were added before – "12. ", "7) ", "[3] ", "004:" or a number followed by a tab – for example from code copied out of a book or a PDF.

Limits & privacy

Text and files can be up to 200 MB. For files above 8 MB the lines are counted first (for padding and counting down), then numbered in a second pass in a background worker.

The format must contain {n}; if it does not, the number is placed before your text. \t in the format inserts a tab. Remove mode recognises numbers at the very start of a line (after optional spaces), with or without one of . : ) ] - or a tab.

Your text stays in your browser and is never uploaded. See the privacy page.

FAQ

How do I number lines starting from 0 or 100?

Set Start at to the first number you need. Step sets the increase between lines.

How do I add leading zeros to line numbers?

Choose Leading zeros under Align numbers. With 250 lines the numbers run from 001 to 250.

Can I number only the lines that are not empty?

Yes, turn on Skip empty lines. Empty lines are kept but get no number and are not counted.

How do I remove line numbers from copied code?

Choose Remove numbers. A leading number with its punctuation and one following space or tab is removed from every line. Lines that start with a real number lose it too, so check the result.

Will numbering change my line endings?

No. Windows and Unix line endings and a final line break are kept.

Related tools