Delete Empty Lines
Remove unwanted blank lines, collapse multiple gaps into single lines, and clean whitespace.
Automatically add customizable line numbers to text, source code, legal briefs, and lists. Supports Roman numerals, custom prefixes, leading zero padding, and non-empty line filters.
Enter your text or code in the Original Text editor, or click Load Sample to test numbering features instantly.
Choose between Number All Lines (indexes blank lines) or Number Non-Empty Lines (skips empty paragraphs).
Pick quick presets (dots, brackets, dashes), select Roman numerals or letters, adjust start numbers, or configure leading zero padding.
Your numbered text updates in real time. Click Copy Result to copy to your clipboard or Download (.txt) to save to your device.
Depending on whether you are indexing an academic essay, a legal contract, or software source code, different rules apply to blank lines. Our line number adder gives you complete control over how empty lines and paragraphs are treated:
Every line without exception receives an incrementing line number. Blank lines between paragraphs receive their own numbers, ensuring physical line index parity.
Input: Apple Banana Orange Output: 1. Apple 2. Banana 3. 4. Orange
Blank lines remain unnumbered. The numbering counter pauses on blank lines so that only lines with actual content receive sequential numbers. Perfect for outlines and lists.
Input: Apple Banana Orange Output: 1. Apple 2. Banana 3. Orange
Blank lines remain visually unnumbered, but the numbering counter advances. Content lines maintain exact line-number synchronization with IDE code editors.
Input:
function test() {
return true;
}
Output:
1. function test() {
3. return true;
4. }
Standard line number tools restrict you to basic digits. Our tool offers flexible number systems and an expressive custom template placeholder syntax:
| Format Preset | Template Syntax | Output Preview | Common Use Case |
|---|---|---|---|
| Dotted Decimal | %n. | 1. Item | General lists, essays, task instructions |
| Single Parenthesis | %n) | 1) Item | Multiple-choice tests, step sequences |
| Enclosed Parentheses | (%n) | (1) Item | Legal clauses, contracts, statutory citations |
| Square Brackets | [%n] | [1] Item | Academic citations, bibliography, log lines |
| Hyphen Dash | %n - | 1 - Item | Meeting minutes, agenda line items |
| Zero Padded | %n. (pad: 3) | 001. Item | Log files, batch file renaming, alignment |
| Roman Numerals | (Base: Roman) | I. Item | Outlines, legal briefs, book chapters |
With Custom Format Pattern, you can type any arbitrary prefix or suffix. Use %n for the calculated line number, %total for the document's total line count, and %len for the character count of each line. For instance, entering [Line %n of %total] produces [Line 01 of 45].
Prepare code snippets for documentation, PR reviews, email discussions, and technical blog posts. By numbering code lines, reviewers can refer directly to specific line numbers (e.g., "see line 42") without ambiguity.
Legal pleading papers, statutory exhibits, and contracts require exact line numbering for courtroom deposition references. Use custom parentheses (%n) or Roman numerals to match jurisdictional formatting requirements.
Format poetry, dramatic play scripts, survey questions, and transcription files where line citations are required. Use our Word & Character Counter to verify academic length limits.
Unlike server-based online converters that upload your confidential source code, legal transcripts, or proprietary data to remote cloud servers, AllToolsNow executes all line numbering computations locally inside your web browser memory.
No network requests containing your text payload are ever dispatched. You can disconnect your internet connection entirely and the tool will continue functioning with full speed, guaranteeing complete compliance with strict enterprise data privacy policies.
When 'Number Non-Empty Lines' is selected, blank lines remain blank with no prefix. The numbering counter pauses on blank lines so that only lines containing actual content receive sequential numbers.
Yes. Choose 'Custom Format' from the presets to define custom patterns using %n as the number placeholder. For example, [%n] produces [1], [2], [3], and Line %n: produces Line 1:, Line 2:, Line 3:.
Under the Zero Padding setting, select 'Auto' to automatically pad numbers with leading zeros based on your total line count (for example 001 through 250), or pick a fixed width like 2, 3, 4, or 5 digits.
Yes. The numbering prefix is inserted at the start of each line without altering interior spaces, tabs, or block indentation. Python code, YAML configurations, and Markdown lists remain fully intact.
No. All text processing occurs 100% locally in your web browser memory using client-side JavaScript. Your text is never transmitted over the internet or logged on any remote server.
Check the 'Strip existing line numbers' option in the settings. The tool will automatically detect and remove previous numbers (such as 1., 01), [1], or (2)) before applying your new custom numbering scheme.
Remove unwanted blank lines, collapse multiple gaps into single lines, and clean whitespace.
Remove unwanted hard line breaks from PDFs, join lines with spaces, or convert to commas.
Count characters, words, sentences, paragraphs, and reading time in real time.
Sort lines alphabetically, numerically, reverse order, and remove duplicate entries.
Collapse redundant spaces, clean trailing whitespace, and normalize tabs.
Convert text between UPPERCASE, lowercase, Title Case, camelCase, and snake_case.