CalcTimer

Add Line Numbers to Text Online

Adds a number to the start of every line.

How to use the Add Line Numbers to Text Online

  1. Paste the block of text you want numbered into the input box.
  2. The output box refills as you type, with 1. 2. 3. in front of each line.
  3. Delete any trailing blank line, or it returns as a numbered empty entry.
  4. Press the copy button to take the numbered text with you.

Blank lines are numbered too

The text is cut at every line break and each piece takes the next number, empty pieces included. A list with gaps between sections numbers the gaps too, so the last number counts lines rather than items.

What the 1. prefix does to Markdown and code

The prefix is a number, a full stop and one space. In Markdown that turns each line into an ordered list item, which renderers renumber themselves. In code the digits become part of the text, so the snippet no longer runs.

Frequently asked questions

Are blank lines numbered?

Yes, blank lines get numbers too.

Can I change the format?

No. The output is fixed as a number, a full stop and a space. For another separator, copy the result and run one find and replace in your editor.

Can I start the numbering at something other than 1?

No. The counter always begins at 1 and there is no offset field. Number the text, then delete the leading lines you do not want.

Does it number lines that only wrap on screen?

No. A line ends at a line break, not at the edge of the box, so a paragraph wrapping over four rows gets one number.

Do the numbers line up in columns?

Not on their own. There is no zero padding, so 9. is a character shorter than 10. Add the zeros yourself if it matters.