Skip to tool

Free · no account · browser only

Add Line Numbers to any text

Prepend line numbers to every line of text. Choose the starting number, separator style, and zero-padding. Using Microsoft Word? Here's how

Numbers as real text you can paste anywhere

  • 1.6 formatsOr your own with #
  • −Remove tooStrip old numbers
  • .pyOpen a fileText, logs or code

Add Line Numbers

Paste text and get numbered lines as you type.

0 lines · 0 empty

Mode

Output · Add numbers

Options
Format

/add-line-numbers

How it works

Five steps. The result updates as you type.

  1. 1

    Paste text or open a file

    Type, paste, or open a text or code file (.txt, .log, .md, .csv, .json, .js, .ts, .py, .html, .css).

  2. 2

    Set the start

    Start at 1, or any whole number.

  3. 3

    Pick a format

    1. 1: 1) or your own with #.

  4. 4

    Read the result

    The output updates as you type.

  5. 5

    Copy or download

    Copy, or Download .txt with your file name. An opened file keeps its name, such as sample-numbered.py.

Frequently Asked Questions

Answers about Add Line Numbers.

How do I add line numbers in Microsoft Word?

Open Layout, click Line Numbers and pick Continuous. This page numbers plain text instead, so you can paste it anywhere.

How do I remove line numbers?

Switch Mode to Remove and pick the format your lines use. Lines in a different format are left as they are.

How do I make my own format?

Pick Custom and type your format with # where the number goes. For example, [#] gives [1] alpha. Line 1 is previewed under the field as you type.

How do I write a # sign in the format?

Type ## for one # sign. For example, Line ## # gives Line # 1.

Are blank lines numbered?

Yes, by default. A numbered blank line is just the number, such as 3. with no space after it. Pick Leave unnumbered under More options to skip them. A line break at the very end doesn't add an extra numbered line.

Can I open a file instead of pasting?

Yes. Click Open file, or drop one file on the input. Text and code files work: .txt, .log, .md, .csv, .json, .js, .ts, .py, .html and .css. Download keeps the file's name and line endings, so sample.py downloads as sample-numbered.py.

Is my text uploaded?

No. Your text is processed in your browser and is never sent anywhere.

Using Microsoft Word?

Word adds numbers in the margin of the document itself. This page can't change a .docx file.

  1. Open the Layout tab.
  2. Click Line Numbers.
  3. Pick Continuous, Restart Each Page, or Restart Each Section.
Microsoft's guide: add or remove line numbers