FormatterHQ

Add Line Numbers

Number every line of a text in one step. Choose the start number and step, the format (1. 1) 1: and more), zero padding, and whether empty lines get a number.

Input TEXT
Output TEXT
Ready.

How to use the Add Line Numbers

  1. Paste your text into the input box.
  2. Set Start at, Step and the Format of the numbers.
  3. Choose Padding and what happens to Empty lines.
  4. Copy or download the numbered text. To take numbers off again, press Remove numbers.

Add line numbers to any text

This tool adds line numbers to text: paste a list, a poem, a script, a log or a block of code and every line gets a number at its start. Numbered lines are easier to discuss (“see line 14”), to turn into a numbered list for a document or e-mail, or to cite in a review. The result updates as you type or change an option.

Example

Preheat the oven to 200 °C.
Mix flour, salt and baking powder.

Stir in the milk.

With the format 1. text and Keep, no number for empty lines, you get:

1. Preheat the oven to 200 °C.
2. Mix flour, salt and baking powder.

3. Stir in the milk.

Options explained

  • Start at: the first number, such as 1, 0 or 101 to continue an earlier list. Negative numbers work too.
  • Step: how much each number grows: 1 for 1, 2, 3; 10 for 10, 20, 30, as in old BASIC listings.
  • Format: the text between the number and the line: 1. , 1) , 1: , 1 - , 1 | , a tab (handy for pasting into a spreadsheet, where the numbers land in their own column), a single space, or your own custom separator.
  • Padding: Zeros gives 01, 02 … 10 so the numbers sort correctly as text; Spaces right-aligns them ( 9, 10) so the text after them lines up in a monospace font. The width follows the largest number.
  • Empty lines: Number them counts every line, which matches the line numbers in a code editor; Keep, no number leaves blank lines in place without using up a number; Remove them deletes blank lines before numbering. Lines holding only spaces count as empty.

Removing line numbers

The Remove numbers button does the opposite: it takes the number and its separator off the start of each line. It recognises the formats above (“1. ”, “01) ”, “ 3: ”, “4 - ”, “5 | ” and a number followed by a tab), so a number that is part of the sentence, as in “2026 was a good year”, stays. Use it to clean code copied from a web page or a PDF that included line numbers.

Line endings and the last line

Windows (CRLF) line endings are kept as they are, so the result pastes back into the same file type. If your text ends with a line break, that final break is kept and does not receive a number of its own. Long lines are numbered once, however they wrap on screen, because numbering follows the actual line breaks.

When to use other tools

To put the same text before or after every line rather than a number – quotes, bullets or HTML tags – use Text Replacer with a regular expression. To clean up first, Remove Empty Lines deletes blank lines and Sort Text Lines puts the lines in order before you number them. The numbering runs in your browser and your text is not uploaded.

Frequently asked questions

How do I number lines without numbering blank lines?
Set Empty lines to Keep, no number. Blank lines stay where they are and the numbering continues on the next line with text. Choose Remove them if you want the blank lines gone.
How do I add leading zeros like 001?
Choose Padding: Zeros. The width follows the largest number in your text, so 100 lines are numbered 001 to 100. Leading zeros keep the lines in order when they are sorted as text.
Can I start numbering at a number other than 1?
Yes. Type any whole number in Start at, for example 0 or 51 to continue a list, and set Step to count in twos, tens or any other interval.
How do I remove line numbers from code I copied?
Paste the code and press Remove numbers. It removes a number followed by one of the supported separators at the start of each line and leaves the rest of the line unchanged.
Will this change my line endings?
No. Windows CRLF and Unix LF line endings are kept, and a final line break at the end of the text stays without being numbered.

Last updated October 17, 2026

Related tools

Add Prefix and Suffix to Lines Add text to the start and end of every line at once: quote list items, add bullets, commas or HTML tags. Skip empty lines, trim spaces. Multiline to Single Line Join multiple lines into one line with a space, comma or custom separator, optionally quoting each item. Remove Line Breaks Remove line breaks from text copied out of PDFs or e-mails, optionally keeping paragraph breaks. Alphabetical Order Put a list into alphabetical order (A–Z or Z–A), optionally ignoring leading articles like "The". ASCII Art Text Generator (FIGlet) Turn text into large ASCII art banners with 30 FIGlet fonts. Wrap them as code comments for README files, CLIs and source headers. Case Converter Convert text to UPPER, lower, Title, Sentence, camelCase, snake_case, kebab-case, PascalCase and more. Delimited Text Extractor Extract one or more columns from CSV, TSV, pipe or any delimited text by column number. Email Extractor Extract e-mail addresses from any text: remove duplicates, sort, lowercase, filter by domain and choose a separator. Shows a count. Flesch-Kincaid Grade Level Calculator Calculate the Flesch-Kincaid grade level and Flesch reading ease score of English text. Font Generator (Fancy Text) Type text and copy it in bold, italic, cursive, gothic, double-struck, bubble, wide and 20 more Unicode styles that paste anywhere. HTML Stripper Strip HTML tags from markup and keep only the readable text, with entities decoded. Invisible Character Detector & Remover Find zero-width spaces, non-breaking spaces, BOMs, bidi overrides and other hidden Unicode characters — then remove or escape them.