How to use
Paste your text
Paste code, logs or a document into the Text to number box. Press Try sample to load a short JavaScript snippet with a blank line in it.
Pick a format and start number
With Add numbers selected, choose a Format, set Start at and Step, pick a Padding and whether to Put the number at the start or end, and tick Skip blank lines if needed.
Copy, or remove numbers instead
Press Copy on the Numbered text pane. To strip existing numbers from pasted code, click Remove numbers and paste the numbered text; the counter shows how many lines changed.
Why Add Line Numbers to Text
- Nine formats, including aligned 1 | text, zero-padded 01. and a custom label.
- Any start number and step, with zero or space padding.
- Skip blank lines, or put the number at the end of each line.
- Remove mode strips line numbers from copied code.
Line number format examples
Each format applied to two lines, a and b, with Start at set to 9 so the padding is visible when the count reaches two digits. Pick the one your destination expects: aligned formats for code in a monospace font, dotted formats for documents, and the tab format for pasting into a spreadsheet, where the number and the text land in separate columns.
| Format | Line 9 | Line 10 |
|---|---|---|
| 1 | text (aligned) | 9 | a | 10 | b |
| 1. text | 9. a | 10. b |
| 1) text | 9) a | 10) b |
| [1] text | [9] a | [10] b |
| 01. text (leading zeros) | 09. a | 10. b |
| 1: text | 9: a | 10: b |
| 1 then a tab | 9(tab)a | 10(tab)b |
| Line 1: text | Line 9: a | Line 10: b |
| Custom, # before and a space after | #9 a | #10 b |