Text Tools
Add Line Numbers
Add line numbers to any text or code online. Decimal, padded, Roman, alpha, hex, or Markdown styles with custom prefix, suffix, and separator.
Quick presets
Numbered output
0 lines, 0 charsLabel style
Choose the format of the label that appears before each line.
Numbering range
Separator, prefix, suffix
The full label is prefix + number + suffix + separator + line.
Padding (lines up numeric labels)
Padding only affects numeric styles (1, 2, 3 padded as 001, 002, 003, and the digit portion of L1 style). Roman, alpha, and Markdown styles are unaffected.
Live label preview
First few labels with your current settings.
- Line 11: First line
- Line 22: Second line
- Line 33:
- Line 44: Fourth line
- Line 55: Fifth line
How to use
- Paste your text or code into the input area on the left.
- Pick a label style (decimal, padded, Roman, alpha, hex, Markdown 1., or L1: code style), or tap a quick preset above the input.
- Set the start number and step, edit the separator, prefix, and suffix if you want a different format like [01] or (1).
- Choose how blank lines should be handled: numbered, skipped (kept blank), or dropped entirely.
- Copy the numbered output with Copy numbered text, or replace the input in place to keep building on the result.
About this tool
Add Line Numbers prepends a label to every line of text or code so each line gets a stable reference you can cite, copy, or share. Nine label styles cover the common cases: plain decimal (1, 2, 3) for casual lists; zero-padded decimal (001, 002, 003) so wide outputs line up in a column; hexadecimal (0x1, 0x2) for memory dumps and engineering tables; uppercase and lowercase Roman numerals (I, II, III and i, ii, iii) for legal documents, outlines, and book chapters; uppercase and lowercase alpha (A, B, C and a, b, c, then AA, AB after Z) for outlines and exam answer sheets; a Markdown ordered-list style (1.) you can paste straight into a README or note; and a code-fence style (L1:) that mirrors the way developers quote line numbers in pull-request comments and bug reports. Numbers can start at any integer (including zero or a negative offset so a header counts as line 0), step by any positive integer (every line, every other line, every fifth line, every tenth line), and be padded automatically to the width of the highest number or to a fixed digit count. The separator between label and content is fully editable, with quick presets for colon-space, dot-space, pipe, dash, single space, or tab. An optional prefix and suffix wrap the label so you can produce bracketed forms like [01], parenthesized (1), or any custom decoration. Blank lines have three explicit handlings: number them along with the rest, keep them blank but skip numbering so the counter only advances for content lines, or drop them entirely before numbering. The output area shows the line count, character count, the highest number used, the resolved padding width, and a live preview of the first few labels so you can iterate on the format without scrolling. Everything runs locally in your browser using deterministic string operations, so the source code, contract paragraphs, exam questions, lyrics, scripts, transcripts, and other private text you paste here never leave your device.
Free to use. Works in your browser. No signup, no login.
Related tools
You may also like
Text Cleaner
Remove duplicate lines, blank lines, extra spaces, tabs, and invisible characters.
Open tool
TextText Sorter
Sort lines alphabetical, natural, numeric, length, random, or reverse with dedupe.
Open tool
TextFind and Replace
Find and replace text in plain or regex mode with live match highlighting.
Open tool
TextWord Counter
Live word, character, sentence, paragraph, and reading time stats.
Open tool
TextCharacter Counter
Detailed character, letter, number, space, and line counts.
Open tool