HandyBench

Add Line Numbers

Prefix every line with a sequential number.

How to use the Add Line Numbers

  1. 1 Paste your text — each line will be numbered.
  2. 2 Set the starting number and the separator (e.g. ". ").
  3. 3 Optionally zero-pad the numbers or skip blank lines, then copy.

How each line gets its number

The text is split on line breaks (Windows or Unix) and every line is rewritten as the number, then the separator, then the original line. You control four things: the starting number, the separator string, zero-padding and whether to skip empty lines. The separator is inserted exactly as typed, so . , ) , : and | all work, and so does an empty field if you want numbers glued to the text.

Padding rule

With "Pad with zeros" on, the width is worked out from the highest number that will be printed, not from a fixed setting. Ten lines starting at 1 give two-digit numbers, so ten steps become:

01. Step 1
02. Step 2
...
09. Step 9
10. Step 10

Starting at 95 with ten lines tops out at 104, so every label is three digits wide and begins 095. Equal widths keep monospaced columns aligned and make the lines sort correctly as plain text.

Skipping empty lines

When "Skip empty lines" is ticked, blank (or whitespace-only) lines are passed through unnumbered, and they do not use up a number. Numbering alpha, a blank line, beta, gamma with ) as the separator gives:

1) alpha

2) beta
3) gamma

With the option off, the blank line would take number 2 and its own label (2) ), and the last two lines would become 3 and 4.

Edge cases

  • The trailing newline. If the pasted text ends with a line break, that break only ends the last line: a two-line list ending in a break still gets numbers 1 and 2, and the final break is kept. Blank lines in the middle of the text are still numbered unless "Skip empty lines" is ticked.
  • Numbers are plain digits. The tool does not produce roman numerals, letters or multi-level numbering such as 1.1 and 1.2. For letters or bullets, use Add Prefix and Suffix to Lines and type the marker yourself.
  • It numbers lines, not sentences. A paragraph wrapped over three display lines is one numbered line unless it contains real line breaks. If you pasted hard-wrapped text, join it with Remove Line Breaks before numbering.
  • Re-running stacks numbers. Numbering text that is already numbered adds a second set in front. Remove the old ones first with a regex in Find and Replace, for example ^\d+\. on a single line.

Common uses are numbering log excerpts so colleagues can refer to a line, numbering quiz questions, and turning a loose list into steps. To put the list in order first, use Sort Lines.

Examples

  • ▸ Turning a plain list into a numbered, step-by-step list.
  • ▸ Numbering log lines or quiz questions.

Frequently asked questions

Can I start numbering from a number other than 1?

Yes. Set any starting value — useful when you are continuing a list from an earlier section.

What does "pad with zeros" do?

It pads numbers with leading zeros to the width of the highest number, so ten lines become 01, 02 … 10. The list then lines up in monospaced fonts and sorts correctly as plain text.

What does "Skip empty lines" do to the numbering?

Blank lines are left unnumbered and do not use up a number, so a list of three items with a gap in the middle is still numbered 1, 2, 3. With the option off, each blank line gets a number of its own.

Does a trailing line break get its own number?

It should not appear. A line break at the very end of your text just ends the last line, so no extra number is added and the trailing line break is kept in the result. A blank line in the middle of the text is numbered unless "Skip empty lines" is ticked.

Can I use something other than a full stop after the number?

Yes. The separator is inserted exactly as typed, so ") ", ": ", " - " or a tab all work. Leave it empty if you want the number attached directly to the text.