Number every line

Add line numbers prefixes every line with its position in the document. The default format is 1. line one, 2. line two, and so on. Customise the separator with Suffix, change the first number with Start at, skip blank lines with Skip Empty, or override the layout entirely with a Format pattern that uses %n as the placeholder.

Input
Line 1:1 LF cloud_done Saved locally
Result Number Lines
0 lines 0 chars

Numbered lines with full control over the layout

Each line is prefixed with a counter that starts at Start at (default 1; 0 is allowed because the registry sets min: 0). The default separator between the number and the line is . (period plus space), set via Suffix. Change Suffix to ) , : , \t, or anything else you need.

Skip Empty leaves blank lines unnumbered and does not advance the counter on them. So in line A / blank / line B with the toggle on, line A is 1 and line B is 2; the blank line stays blank. With the toggle off the blank line gets numbered too.

Format overrides Suffix when populated. It is a template containing %n, which is replaced by the current number. Examples: [%n] produces [1] line, %n) produces 1) line, L%n: produces L1: line. Leave Format empty to fall back to the suffix-based layout.

How to use number every line

  1. 1Paste or type your text into the input panel on the left.
  2. 2Set Start at to the number you want the first line to use (default 1).
  3. 3Adjust Suffix if you want a different separator between the number and the line text.
  4. 4Toggle Skip Empty on to leave blank lines bare and unnumbered.
  5. 5Optionally type a Format pattern with %n to override the default layout.

Keyboard shortcuts

Drive TextResult without touching the mouse.

Shortcut Action
Ctrl FOpen the find & replace panel inside the input Plus
Ctrl ZUndo the last input change
Ctrl Shift ZRedo
Ctrl Shift EnterToggle fullscreen focus on the editor Plus
EscClose find & replace, or exit fullscreen
Ctrl KOpen the command palette to jump to any tool Plus
Ctrl SSave current workflow draft Plus
Ctrl PRun a saved workflow Plus

What this tool actually does

Counter starts at any non-negative integer

Start at defaults to 1. The registry allows min: 0, so a literal 0 is honoured (you can start with 0. line if you prefer zero-based numbering).

Skip Empty stops the counter on blanks

When the toggle is on, lines whose trim() is empty are passed through unchanged and the counter does not advance for them. Numbered lines stay densely sequential.

Custom Suffix between number and line

The suffix sits between the number and the line content. The default is . ; common alternatives are ) , : , or a tab. The suffix is inserted verbatim, no trimming.

Format overrides the default layout

When Format is non-empty, the tool runs format.replace(/%n/g, num) and prepends the result to the line. Use [%n] , %n) , L%n: , or any pattern with one or more %n placeholders.

Line endings are normalised on output

The split uses \r?\n and the join uses \n, so CRLF input becomes LF output. The numbering and content are preserved verbatim.

Worked example

Format [%n] , Skip Empty on. The blank line stays blank, the counter advances only on non-blank lines.

Input
alpha
bravo

delta
Output
[1] alpha
[2] bravo

[3] delta

Settings reference

Behaviour Effect on output
Start at First counter value. Default 1. 0 is permitted.
Suffix String inserted between the number and the line content. Default . .
Skip Empty off Every line gets a number, including blank ones.
Skip Empty on Lines whose trim() is empty are passed through; counter does not advance.
Format empty Falls back to number + suffix + line.
Format with %n Layout is format.replace(/%n/g, number) + line. Suffix is ignored.
Line endings CRLF input becomes LF output. Numbers are preserved verbatim.

FAQ

Can I start the count at zero?
Yes. Set Start at to 0. The first line will be numbered 0.
How do I get brackets around the numbers?
Set Format to [%n] . The placeholder %n is replaced by the current number for each line.
What does Skip Empty do to the counter?
With the toggle on, blank lines are not counted. The counter only advances when a non-blank line is numbered, so the visible numbers are dense and consecutive.
How do I remove the line numbers later?
Use regex replace with a pattern like ^\d+\.\s* and flags gm to strip leading numbers from each line.
Does anything upload?
No. The transform runs in your browser. Nothing is uploaded or logged.