Prefix every line with a number — instant, flexible, copy-ready
5 lines detected
Options
Need to add line numbers to a block of text? This free online tool prefixes every line instantly. Choose the starting number, pick a separator style (period, colon, parenthesis, pipe, or custom), control zero or space padding so columns stay aligned, and optionally skip blank lines. Perfect for code snippets, scripts, instructions, and documents where numbered lines aid readability or reference.
Yes. Set any integer as the start number — including 0 or negative numbers. The tool will number lines sequentially from that value onward.
Padding aligns numbers so all lines start at the same column. 'Spaces' pads short numbers with leading spaces (e.g. ' 1' vs '10'), while 'Zeros' uses leading zeroes (e.g. '01' vs '10'). 'None' writes the number as-is.
Blank lines are left as-is with no number prefix, and the line counter skips over them, so only non-empty lines get numbered. This is useful for prose with paragraph breaks.
The pipe separator (1 | line) is popular for code listings because it clearly separates the number from code syntax. The colon (1: line) works well for instruction steps and numbered lists.