Line Number Add/Remove

Add numbers to each line of text, or remove existing line numbers.

Category: Text Tools

When to use?

Use it to add line numbers so specific lines are easy to reference in a code review or shared document, or to strip numbers from numbered text.

How to use

  • Enter text.
  • Choose add or remove line numbers.
  • Set the start number and separator.
  • Copy the result.

Input Explanation

Enter the multiple lines of text to number or de-number.

Calculation Basis

It splits text into lines and prepends an incrementing number from the chosen start; to remove, it strips a leading number pattern with regex.

Usage Examples

  • Add numbers for code review - Add line numbers to code or docs to reference specific lines easily.
  • Use after removing numbers - Quickly strip numbers from numbered text.
  • Prepare teaching materials - Add line numbers to example text to point out positions clearly.

Examples

  • Add: "apple\nbanana" → "1. apple\n2. banana"
  • Remove mode → strips numbers and dots from a "1. apple" list to restore the original

Cautions

  • Counts can vary by how line breaks are handled.
  • Results may differ from other tools depending on whitespace handling.

Guides

Add line numbers

It automatically prepends sequence numbers to each line. Useful for code review, document sharing, and referencing specific lines clearly.

Set the start number

To start from a number other than 1, change the start value. If a step is available (e.g. 10, 20, 30), you can make BASIC-style labels too.

FAQ

Can I change the start number?

Yes, set the start number and separator to any value.

How does removal work?

It auto-detects the leading number-and-separator pattern and removes it.

Do numbers stay tidy with many lines?

Numbers display neatly even with many lines, and you can copy the result as-is.

Can I remove the numbers again?

Yes. Remove mode detects leading numbers and separators to restore the original text.

Related Tools

  • Character Counter - Count characters with and without spaces, and line count, in real time.
  • Byte Counter - Calculate the byte length of text when stored as UTF-8.
  • Case Converter - Convert text, variable names, and filenames to UPPER, camelCase, snake_case, kebab-case, and more.
  • Whitespace Remover - Remove whitespace in various ways — leading/trailing, duplicate, or per-line.
  • Duplicate Line Remover - Remove duplicate lines from text, keeping only unique lines.
  • Line Sorter - Sort each line of text in ascending/descending order, or shuffle randomly.