Skip to content
XUtilHub

Add Line Numbers to Text Online

Number every line of your text with a custom start, format and alignment. Optionally skip empty lines. Free online tool.

  • Free, no sign-up
  • Runs in your browser, nothing uploaded
Input
Output

About the Add Line Numbers

Add line numbers to text, code or lists. Choose the starting number and format (1. 1) 1:), align numbers, and skip blank lines if you like.

Key features

  • Number every line instantly
  • Choose the start number
  • Formats: 1. 1) 1: 1 - or tab-separated
  • Right-align numbers so text lines up
  • Skip blank lines without breaking the sequence
  • Copy or download the result

Number lines in seconds

Line numbers make it easy to refer to a specific step, a line of code, a line in a poem or script, or a row in a list. Paste your text, choose a format and copy the numbered result.

Format examples

FormatResult
1. text1. Preheat the oven
1) text1) Preheat the oven
1: text1: Preheat the oven
1 - text1 - Preheat the oven
1<tab>text1 Preheat the oven (pastes into two spreadsheet columns)

Aligned numbering

Without alignment:

9. Ninth line
10. Tenth line

With alignment:

 9. Ninth line
10. Tenth line

Common uses

  • Code reviews and documentation: reference "line 42" precisely.
  • Legal and academic texts: cite specific lines in transcripts, poems and contracts.
  • Recipes and instructions: turn plain lines into numbered steps.
  • Spreadsheets: use the tab format to create an index column.

Sort the lines first with Sort Text Lines, remove blanks with Remove Empty Lines, or add custom prefixes with the String Builder.

How to use the Add Line Numbers

  1. Type or paste your text into the input box.
  2. Choose the options you want.
  3. The result updates instantly as you type.
  4. Copy the output or download it as a .txt file.

Frequently asked questions

Can I start numbering from a number other than 1?

Yes. Set 'Start at' to any number, which is useful when continuing a list or quoting code from the middle of a file.

What does 'Align numbers' do?

It pads shorter numbers with spaces so all text starts in the same column: ' 9.' and '10.' line up.

How are empty lines handled?

With 'Skip empty lines' on, blank lines are kept but not numbered, so the numbering continues on the next line with text. Turn it off to number every line.

How do I remove line numbers?

Use Find and Replace with the regular expression ^\s*\d+[.):]?\s* and an empty replacement.

Is my text sent anywhere?

No. All text tools run locally in your browser.

Do these tools support Unicode?

Yes. They handle Unicode text, including emoji and accented characters.

Last updated:

Related Text tools