ToolBark
Text

Add Line Numbers to Text

Prefix every line with a number — instant, flexible, copy-ready

5 lines detected

Options

5 lines numbered
About

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.

FAQ
Can I start numbering from a number other than 1?+

Yes. Set any integer as the start number — including 0 or negative numbers. The tool will number lines sequentially from that value onward.

What does the padding option do?+

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.

What happens to blank lines when I enable 'skip empty lines'?+

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.

Which separator should I use for code listings?+

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.

Related tools