🔢 Add Line Numbers
Add line numbers to text or code with customizable starting number, separator, and zero-padding — all in your browser, no upload, instant results.
About the Add Line Numbers tool
This add line numbers tool runs entirely in your browser. Paste any text or code into the input box, configure the starting number, separator, and zero-padding width, then click Add Numbers to produce numbered output. Nothing is uploaded to a server — the conversion happens instantly with JavaScript on your device.
Options explained
- Start at — The number assigned to the first line. Defaults to 1, but you can start at 0 or any other number.
- Separator — The text placed between the line number and the line content. Common choices are
". "(dot space)," | "(pipe),": "(colon space), a plain space, or a tab. - Zero-pad width — Pad line numbers with leading zeros to a fixed width. For example, with padding 3, the first line becomes
001. Set to 0 for no padding.
How to use the tool
- Paste or type your text or code in the input box.
- Set the starting number, separator, and padding width.
- Click Add Numbers — the numbered result appears in the output box.
- Click Copy to copy the result to your clipboard, or Clear to start over.
Frequently asked questions
Does this tool upload my text? No. All numbering happens locally in your browser. Your text never leaves your device.
Can I number only part of a file? Yes — paste just the lines you want numbered. The tool processes whatever is in the input box.
Does it preserve empty lines? Yes. Empty lines are still counted and numbered, so the original line structure is preserved.
Is there a length limit? The only limit is your browser's available memory. Even very long documents convert instantly.