Add/Remove Line Numbers
Add or remove line numbers from text with customizable formatting. Choose separators, starting numbers, leading zeros, and alignment options.
All processing happens in your browser — your text is never sent to any server.
Embed This Tool
Add this tool to your website with customizable styling
How to Use
- 1 Choose your mode - select "Add Numbers" to add line numbers to text, or "Remove Numbers" to strip existing line numbers.
- 2 Paste your text into the text area. Works with code, documents, lists, or any multi-line text.
- 3 Configure options when adding numbers: set starting number, choose separator (dot, colon, parenthesis, tab), and enable leading zeros or right-alignment.
- 4 Copy the result using the copy button. Use the swap button to quickly move the output back to input for further processing.
Frequently Asked Questions
When would I need to add line numbers?
Line numbers are useful for code snippets in documentation, legal documents, scripts, poetry formatting, and when referencing specific lines in collaborative editing. They make it easy to discuss and reference specific parts of a document.
Can this tool handle code with existing indentation?
Yes, line numbers are added at the beginning of each line while preserving all existing indentation and formatting in your text. Your code structure remains intact with numbers prepended.
What formats can be removed?
The tool auto-detects common formats like "1. ", "1: ", "1) ", and tab-separated numbers. It handles both with and without leading zeros, and works with various spacing patterns.
Does this preserve empty lines?
You can choose to number empty lines or skip them using the "Include empty lines" checkbox. When removing numbers, empty lines are always preserved in their original positions.
Is my text stored or shared?
No. All processing happens entirely in your browser. Your text is never sent to any server, stored, or shared. This tool is 100% private and works offline once loaded.