Developer Lists

Number lines

What to do

Transformed in your browser · nothing is uploaded

Local · blanks are skipped, not numbered
Advertisement
320 × 100

Puts a number and a full stop in front of every line, starting at one. Blank lines are skipped rather than numbered, so the count matches the items and not the whitespace. Two lines reading alpha and bravo come back as 1. alpha and 2. bravo.

How to use the number lines

1 Paste the list, one item per line.
2 Number the lines is the default option.
3 To de-duplicate or sort first, run that option and paste its result back in.
4 Copy the numbered list.

Skipping the blanks is the choice that makes this useful rather than merely mechanical: a list with a stray empty line between items should number 1, 2, 3, not 1, 3, 4, so empty lines are dropped entirely rather than counted. The cost of that decision is that this is not a code editor’s gutter: it cannot number every line including the empty ones, and it always starts at one, so it will not match a listing that starts at 100.

The numbers it adds are plain text, not a list format, and three things follow from that. Sort a numbered list afterwards and 10. lands between 1. and 2., because it sorts as text, so sort first, then number. Paste one into a word processor and autoformat may recognise the pattern and convert it into a real numbered list, renumbering as it goes. And running it over a list that is already numbered gives you two numbers on every line; strip the old ones with find and replace first. The numbers are not padded either, so 9. and 10. will not line up in a monospaced column.

Questions

No, they are removed. The numbers count items rather than whitespace.

MDN, working with strings
Advertisement
300 × 250
Was this tool any good?
Internal signal only · I use it to find the tools worth rebuilding