
Number lines
Number lines. Runs entirely on your device, nothing is uploaded.
Number lines prefixes every line of a pasted text with its line number, right-aligned to the width of the largest number in the file. A trailing newline in the input is preserved rather than becoming an extra blank line. Numbering always restarts from 1, so it cannot continue a count from an earlier file. Blank lines still receive a number.
Questions
How is the number width chosen?
It is the character length of the total line count, so a ten-line file gets single-digit numbers and a file with over a thousand lines gets four-digit numbers. Every number is right-aligned to that same width, so the colons all line up in a column.
Do blank lines get numbered too?
Yes. Every line, blank or not, receives a number, since the tool counts by line position rather than by whether the line has content.
Can I start numbering from something other than 1?
No. There is no starting-number option; every run begins at 1 and there is no way to continue a count across two separate files.
What happens to a trailing newline in my file?
It is preserved. The tool detects whether the input ends in a newline before splitting into lines, and if so, restores that same trailing newline after numbering, rather than adding or losing one.
Does numbering change the text of each line?
No. Only a number and a colon are added at the start of the line; the rest of the line, including its own leading or trailing whitespace, is unchanged.
Compare
| Tool | Runs on the CLI | Live as you type |
|---|---|---|
| Number lines | Yes | Yes |
| Reverse lines | Yes | Yes |
| Shuffle lines | Yes | Yes |
| Sort lines by length | Yes | Yes |
| Unique lines with counts | Yes | Yes |
| Prefix or suffix lines | Yes | Yes |
| Extract lines | Yes | Yes |