Runs 100% in your browser — nothing is uploaded
Text & String

Add / Remove Line Numbers

Prefix every line with a sequential number, or strip existing numbering back out, entirely client-side.

Add / Remove Line Numbers
Client-side

About this tool

The Line Numberer adds sequential numbers to the start of every line in a block of text, or strips numbering that is already there — a task that comes up when preparing code snippets for documentation, formatting numbered reference lists, annotating log output for a bug report, or cleaning up text copy-pasted from a numbered source.

In "Add" mode, choose a starting number, a separator style — dot-space ("1. "), paren-space ("1) "), or tab — and whether numbers should be zero-padded to a consistent width. In "Remove" mode, the tool strips a leading number-plus-separator pattern from each line. Auto-detect mode recognizes all three separator styles per line, so a file with mixed numbering still cleans up correctly.

Everything runs as plain string and regex operations in your browser. The tool reports how many lines were actually modified so you can spot-check that the pattern matched what you expected.

FAQ

What separator styles does the Remove mode understand?
It recognizes "1. " (dot-space), "1) " (paren-space), and tab-separated numbering. In auto-detect mode it checks each line against all three patterns independently.
What does "pad with zeros" do?
It pads every line number to match the width of the largest number in the list, keeping numbers visually aligned in monospaced text.
Can I start numbering from something other than 1?
Yes — set the "Start at" field to any integer, useful when numbering a continuation of a list.
Will this work on code snippets?
Yes, it treats input as plain text line-by-line, so it works on prose, code, log output, or CSV rows.
What happens to blank lines?
Blank lines are numbered like any other line in Add mode. In Remove mode, a blank line has no number prefix to strip, so it passes through unchanged.