Add Line Numbers
Number every line of a text or a code snippet.
INPUT
CHARS: 0WORDS: 0LINES: 0
OUTPUT
CHARS: 0WORDS: 0LINES: 0
How the Add Line Numbers works
Each line gets a number followed by a separator of your choice, such as a period, a colon, a bracket, a pipe or a tab. The start number is adjustable, so you can continue a numbering from another page. Alignment pads the numbers so that the text starts in the same column even when the count reaches two or three digits.
If you do not want blank lines numbered, tick skip blank lines. The remove mode strips numbers from text that already has them, which helps when you copy code from a page that includes line numbers.
Add Line Numbers examples
Sample input with the default options
Input
first line second line fourth line
Result
1. first line 2. second line 3. 4. fourth line
When it is useful
- •Referencing line numbers in a code review or a tutorial.
- •Numbering the lines of a poem, contract or transcript.
- •Cleaning code that was copied with line numbers attached.
- •Creating numbered lists quickly from plain lines.
Frequently Asked Questions
Can I remove line numbers?
Yes. Switch the action to remove and paste the numbered text.
How do I start numbering from another number?
Change the start at field. Use zero if you want zero based numbering.
Will it number empty lines?
Yes by default, so numbers match the real line positions. Turn on skip blank lines to leave them unnumbered.
Related tools
- List ConverterReshape a list for SQL, code or a spreadsheet.
- Duplicate Line RemoverPaste a list and keep each line once, in the order it first appeared.
- Text Diff CheckerPaste an original and a changed version to see exactly what differs.
- Sort Words AlphabeticallyChoose lines, words or comma separated items and sort them in the order you need.