How to Use Add Line Numbers - Free Online Tool
Learn how to effectively use the Add Line Numbers tool to add line numbers to your text with customizable formatting options
What is Add Line Numbers?
The Add Line Numbers tool adds sequential line numbers to your text, making it easier to reference specific lines, debug code, or format content for tutorials and documentation. It supports various numbering formats, alignment options, and customization features to create perfectly formatted numbered text.
Numbering Features
The tool provides extensive numbering options:
- Number Formats: Decimal (1, 2, 3), hexadecimal (1, 2, 3), or custom formats
- Starting Number: Begin numbering from any number (1, 0, or custom)
- Alignment: Left-align, right-align, or center line numbers
- Padding: Zero-padding for consistent width (001, 002, 003)
- Separator: Choose separator between number and text (space, tab, colon, pipe, etc.)
- Numbering Style: Continuous, skip empty lines, or restart per paragraph
- Width: Set minimum width for number column
How to Use
- Enter your text in the input area
- Configure numbering options:
- Start Number: First line number (usually 1)
- Format: Decimal numbers, hex, or custom format
- Padding: Use zero-padding for alignment (001 vs 1)
- Width: Minimum number of digits (3 = 001, 002, etc.)
- Alignment: Left or right-align numbers
- Separator: Character between number and text
- Empty Lines: Number empty lines or skip them
- Preview the formatted output
- Click Add Line Numbers to apply formatting
- Copy or download the numbered text
Examples
Simple numbering:
1 First line 2 Second line 3 Third line
Zero-padded right-aligned:
001 First line 002 Second line 003 Third line
With separator:
1| First line 2| Second line 3| Third line
Use Cases
- Add line numbers to code snippets for tutorials
- Format error messages with line references
- Number lines in documentation
- Create numbered lists and instructions
- Format code for sharing with line references
- Prepare text for code reviews
- Add line numbers to log files or output