Updated · Built and checked by the PlinzoTools team, formulas tested against published sources
Add line numbers to text or code, with a custom start and separator.
1: const a = 1;
2: const b = 2;
3: console.log(a + b);This tool prefixes every line of text or code with its line number -- right-aligned and padded to a consistent width -- the format code snippets, log excerpts, or line-referenced documentation commonly use.
Paste text or code, set a starting number and separator (like ": " or ". "). The numbered result appears instantly.
Each line's number is right-padded to match the width of the largest line number in the block, so all numbers align in a clean column regardless of digit count (e.g. line 9 and line 10 both display with consistent spacing).
"const a = 1;
const b = 2;" becomes:
1: const a = 1;
2: const b = 2;
For adding line numbers as part of code display formatting, pair with the HTML Beautifier or CSS Beautifier when documenting formatted code.
The tool splits your text into lines at each line break, then adds the starting number plus the line position to each one. The width of the number column is set by the largest number that will appear, and shorter numbers are padded on the left with spaces so the separators line up. The separator you type is inserted exactly as written, including any spaces, and then your line follows. The tool starts with the starting number at 1 and a separator of a colon followed by a space.
Imagine you are quoting lines from the middle of a configuration file and want them to match the original line numbers. You paste three lines and set Start At to 98. The largest number is 100, which has three digits, so every number is padded to width 3. The result reads " 98: first line", " 99: second line" and "100: third line", with the first two numbers indented by one space so the colons line up. Without the width padding, the change from two digits to three would have shifted the text and made the block harder to read.
Column width = number of digits in (line count - 1 + start number)
Every line receives a number, including blank ones, so an empty line still gets its own row. If your text ends with a trailing line break, the final empty line is numbered too. If you do not want that, remove the trailing break before numbering. If the Start At field is empty or contains something that is not a number, the tool falls back to 1. A start value of 0 is also treated as 1 because zero counts as an unset value, so if you need numbering that begins at zero, number from 1 and adjust the labels afterward.
Negative starting numbers are accepted by the number field, and the minus sign counts toward the column width when it appears. Because the numbers are padded with spaces, paste the result into a monospaced font, such as a code block, to keep the alignment visible. In proportional fonts, the columns may look slightly uneven even though the underlying text is correct.
Numbered lines make it easier to discuss a code snippet in a review, reference a specific entry in a log, or ask someone to change a line in a pasted list. Remove the numbers again before feeding the text back into a program, since the numbers are now part of each line.
Yes -- set any starting number, useful when numbering a continuation of a larger file or matching an external reference's existing line numbers.
Yes -- enter any separator text, like ". " (period-space) or " | " (pipe), between the number and the line content.
Yes -- the numbering logic works the same regardless of length, automatically widening the number column to accommodate however many digits the largest line number needs.
Yes. Every line gets a number, including empty ones, so blank lines in the middle of your text appear as numbered rows with no content.
They are padded so that all separators line up in one column. The padding is sized to the largest line number in your block.
The tool uses 1 in both cases, because an empty or zero value is treated as not set.
Yes, the numbers become part of each line, so strip them before running or compiling the text again.
Reference: MDN Web Docs