My Tool Studio
Text

Add Line Numbers

Reviewing a contract clause or a stack trace over email turns painful the moment someone writes, see the third paragraph from the bottom. This tool will add line numbers to any pasted text so both of you can say line 47 and mean the same thing. Every line gets a right aligned number followed by a pipe separator, and the padding widens automatically once your text passes 9, 99, or 999 lines, keeping the column perfectly straight. You can add line numbers to text online without installing an editor, and the numbering recalculates live with every edit you make.

Always freeNo sign upRuns in your browser

How to use

01

Paste the text to number

Drop code, contract text, or log output into the input pane. The Try sample button loads three short lines so you can preview the numbering style first.

02

Read the numbered output

The output pane prefixes every line with a right aligned number and a pipe character. Single digit numbers pick up leading spaces whenever the total line count needs more digits.

03

Copy the result

Press Copy above the output pane and paste the numbered text into your email, ticket, or review comment. Clear wipes the input for the next snippet.

Why Add Line Numbers

Common questions

What format do the added line numbers use?
Each line becomes the number, a space, a pipe, another space, then your original text, so line one reads as 1 | followed by the content. The separator is fixed, there's no option to switch it for a period or a tab.
Can the number lines tool start at zero or another offset?
No, counting always starts at 1 and increments by one per line. If you need zero based numbering to match an editor's convention, mention the difference when you cite a line.
Do blank lines receive line numbers as well?
Yes, every line in the paste is numbered, including empty ones. That's deliberate: skipping blanks would make the numbers disagree with what any text editor shows for the same content.
Why are the line numbers padded with extra spaces?
Padding keeps the pipe separators vertically aligned in monospace fonts. The width comes from the total line count, so a 250 line paste pads every number to three characters and the gutter stays straight from top to bottom.
How do I remove line numbers after they've been added?
There's no reverse mode here, but the format is regular enough that Find and Replace handles it: enable regex and replace a pattern like ^\s*\d+ \| with nothing. Keeping the original unnumbered copy is still the easier path.
Is numbering lines helpful for legal documents?
Very. Numbered lines let both sides of a negotiation cite line 112 of a draft instead of quoting whole passages, the same reason court pleading paper has carried line numbers for over a century.
Does adding line numbers alter the original text?
No. Your input stays untouched in the left pane, and the numbering exists only in the output copy. Keep the clean version for anything that goes back into an editor or a build.

More Text tools

View all