What is Add Line Numbers?
Add Line Numbers is a text formatting tool that adds line numbers or custom prefixes to each line of your text. Whether you need numbered lines for code review, bullet points for lists, or quote markers for citations, this tool makes it quick and easy.
Who Uses This Tool?
This tool is useful for anyone who works with text:
Developers
Writers and Editors
Teachers and Students
Legal Professionals
Content Creators
Key Benefits
Flexible Formatting
Use numbered formats like "1. " or "1) ", or static prefixes like "* " or "> "
Custom Patterns
Create your own format using $n as the line number placeholder
Live Preview
See results instantly as you type or change settings
Works with Any Text
Process code, prose, lists, or any plain text content
Your Text Stays Private
- 1. What is Add Line Numbers?
- 2. How to Use Add Line Numbers
- 3. Features
- 4. Frequently Asked Questions
- 4.1. What does $n mean in the format?
- 4.2. Can I use multiple $n in one format?
- 4.3. How do I add bullet points instead of numbers?
- 4.4. Why can't I see the Start and Padding options?
- 4.5. What does "Skip Empty" do?
- 4.6. How does Padding work?
- 4.7. What is the Swap button for?
- 4.8. Is there a limit to how much text I can process?
- 4.9. Is my text private?
- 4.10. Can I use special characters in my format?
How to Use Add Line Numbers
Adding line numbers or prefixes to your text takes just a few steps. Here's how to get started:
Enter Your Text
Paste or type your text in the Input panel on the left. Each line will be processed separately. You can also click the Paste button to quickly paste from your clipboard.
Choose a Format
Select how you want each line to be prefixed:
- Use a Preset - Click one of the preset buttons like
$n.,*, or- - Enter a Custom Format - Type your own format in the Format field. Use
$nas a placeholder for the line number
Adjust Settings (Optional)
Fine-tune the output with these options:
- Start - Set the starting number (default is 1). Only visible when using
$n - Padding - Align numbers with spaces. "Left" right-aligns numbers, "Right" left-aligns them
- Skip Empty - When enabled, empty lines won't receive a prefix
Copy or Download
Once you're satisfied with the result:
- Click Copy to copy the formatted text to your clipboard
- Click Download to save the result as a text file
- Click Swap to move the output back to input for further processing
Format Examples
| Format | Input | Output |
|---|---|---|
$n. |
Apple Banana |
1. Apple 2. Banana |
[$n] |
First Second |
[1] First [2] Second |
* |
Item A Item B |
* Item A * Item B |
> |
Quote here | > Quote here |
Keyboard Shortcuts
Speed up your workflow with these keyboard shortcuts:
- Ctrl + Shift + C - Copy the output
- Ctrl + Shift + X - Clear all text
Features
Add Line Numbers offers flexible text formatting options to suit different needs:
Numbered Line Formats
Add sequential numbers to each line using the $n placeholder. The number automatically increments for each line:
Standard Numbering
$n.→ 1. First line, 2. Second line$n)→ 1) First, 2) Second
Bracketed Numbers
[$n]→ [1] First, [2] Second#$n→ #1 First, #2 Second
Custom Text with Numbers
Line $n:→ Line 1: First, Line 2: Second
Static Prefixes
Add the same prefix to every line - perfect for bullet points, quotes, or indentation:
| Prefix | Use Case | Example |
|---|---|---|
* |
Bullet points for unordered lists | * Item one |
- |
Dash lists, common in Markdown | - Item one |
> |
Quote markers for citations or email replies | > Quoted text |
|
Two spaces for indentation | Indented text |
Custom Start Number
Begin numbering from any number you choose. Useful when:
- Continuing a numbered list from a previous section
- Starting from zero (common in programming)
- Creating numbered items that start at a specific value
Number Padding
Align numbers neatly when working with many lines:
None
Left (Right-align)
Right (Left-align)
Skip Empty Lines
When enabled, empty lines remain empty without receiving a prefix. This keeps your formatting clean when working with text that has blank lines between paragraphs.
Live Preview
The output updates in real-time as you:
- Type or paste text in the input
- Change the format pattern
- Adjust any settings
Swap Function
The Swap button moves your output back to the input, allowing you to apply multiple formatting passes. For example:
First Pass
Add line numbers with $n.
Swap
Move output to input
Second Pass
Add quote prefix with >
Result
> 1. First line
Export Options
Copy to Clipboard
Copies formatted text to clipboard with one click
Download as File
Saves the result as a .txt file
Frequently Asked Questions
What does $n mean in the format?
$n is a placeholder that gets replaced with the line number. For example, if your format is Line $n: , the output will be "Line 1: ", "Line 2: ", etc. If your format doesn't contain $n, every line gets the same prefix.
Can I use multiple $n in one format?
Yes, each $n in your format will be replaced with the same line number. For example, [$n-$n] produces "[1-1] ", "[2-2] ", and so on.
How do I add bullet points instead of numbers?
Simply enter a format without $n. Click the * or - preset button, or type your own static prefix like • or → .
Why can't I see the Start and Padding options?
These options only appear when your format contains $n (line numbers). They're hidden for static prefixes since they don't apply.
What does "Skip Empty" do?
When enabled, empty lines in your text won't receive any prefix or number. They remain blank. When disabled, empty lines get the prefix too (resulting in lines that only contain the prefix).
How does Padding work?
Padding adds spaces to align numbers neatly:
- Left - Right-aligns numbers by adding spaces before: " 1", " 10", "100"
- Right - Left-aligns numbers by adding spaces after: "1 ", "10 ", "100"
- None - No padding, numbers vary in width
What is the Swap button for?
Swap moves the output text back to the input field. This lets you apply multiple formatting passes. For example, first add line numbers, then swap and add a quote prefix on top.
Is there a limit to how much text I can process?
There's no strict limit, but very large texts (tens of thousands of lines) may slow down your browser since all processing happens locally. For best performance, work with text under 10,000 lines at a time.
Is my text private?
Yes, completely. All processing happens in your browser using JavaScript. Your text is never uploaded to any server. You can even use this tool offline after the page loads.
Can I use special characters in my format?
Yes, you can use any characters in your format including Unicode symbols, emojis, or special punctuation. Just type them directly in the Format field.
No comments yet. Be the first to comment!