Add Line Numbers
Put a number in front of every line of a list, a script, a poem or a block of code, starting wherever you like and with the separator you need. The same tool removes numbers from text you copied from a numbered document or a code listing.
Add or Remove Line Numbers
Result
How to Use the Add Line Numbers
- Paste your text into the box.
- Keep Add line numbers selected, then set the start value, the step and the separator (or enter your own).
- Tick zero padding if you want 01, 02 … 10, and choose whether blank lines get a number.
- To strip numbers instead, choose Remove line numbers. Copy or download the result.
About This Tool
Writers preparing scripts and transcripts for review, teachers numbering questions, and developers quoting code with line references or cleaning numbers out of pasted listings.
Input: Plain text · Output: Numbered text.
Features and Limitations
Features
- Any start value (including 0 or negative numbers) and any step.
- Seven ready separators plus a custom one.
- Optional zero padding keeps columns aligned.
- Removal recognises numbers followed by a dot, bracket, colon, bar, tab or space, with or without leading spaces.
Limitations
- Removal only strips a number at the very start of a line; a line that genuinely starts with a number, such as “2024 was a good year”, will lose it too.
- Line wrapping in the box is visual only; numbering follows real line breaks.
- Results are computed in your browser; nothing you enter is sent to a server.
Example
Three lines “apple”, “”, “pear” with start 1 and blank lines skipped become “1. apple”, “”, “2. pear”.
Frequently Asked Questions
Can I start numbering from a number other than 1?
Yes. Enter any whole number in Start at, and use Count by to number in steps such as 10, 20, 30.
What happens to blank lines?
By default they stay blank and do not use up a number. Untick the option to number them like any other line.
How do I remove numbers from copied code?
Choose Remove line numbers. The tool deletes leading spaces, the number and the separator that follows it on every line.
Can I use a tab as the separator?
Yes. Choose “1 then a tab”, which is handy for pasting into a spreadsheet with numbers in their own column.
Related Tools
More like this: all Case & Formatting tools, all Text & Writing tools or the TinySandy home page.