Add Line Numbers to Text

Add Line Numbers to Text — a free online tool.

When line numbers help

Numbered lines make it much easier to reference a specific row when reviewing code snippets, scripts, poetry drafts, or line-separated data with someone else - "check line 14" is a lot clearer than describing where a line sits. This tool just prepends a number and a period to each line; it doesn't touch the actual content, so pasting the result elsewhere keeps your original text intact alongside the numbering.

Why skipping blank lines is a separate option

Some use cases want every line numbered, including blanks, to preserve an exact row-by-row reference (useful when comparing against a tool that also counts blank lines, like most code editors). Others want blank lines left alone so the numbering only tracks actual content lines - which reads more naturally for things like numbered lists of items separated by blank spacing. Having both available covers either case without extra manual cleanup.

Why you can change the separator and starting number

A plain "number, period, space" prefix suits plain text and chat messages, but it isn't the only format people need - "1)" reads more like a numbered outline, "1:" suits some log formats, and a tab character lines numbers up into clean columns when pasted into a spreadsheet or fixed-width editor. The starting number matters when you're numbering a snippet that continues from an earlier block (for example, lines 51 onward of a longer file) and want the numbers to reflect that, rather than restarting from 1.

A note on line-ending differences

The tool recognizes all three common line-ending styles (Windows-style, old Mac-style, and Unix-style) when splitting your pasted text into lines - so content copied from different operating systems or editors numbers correctly either way, rather than being miscounted as one giant unbroken line.

Pertanyaan yang sering diajukan

Can I start numbering from something other than 1?

Yes - set "Start at" to any number. This is useful when the text you're numbering is a continuation of an earlier block and you want the numbers to match its actual position, rather than restarting from 1.

Can I use a separator other than a period, like a colon or a tab?

Yes - the Separator dropdown offers "1. text", "1: text", "1) text", and a tab-separated option, which lines numbers up into clean columns when pasted into a spreadsheet or fixed-width editor.

Can I skip numbering blank lines?

Yes - check "Skip numbering blank lines" before running it, and empty lines will stay unnumbered while the numbering continues on the next line with content.

Will this change my text in any other way?

No - only a number and period are added to the start of each line. Spacing, punctuation and line breaks elsewhere are left exactly as you typed them.

Does it matter what operating system my text came from?

No - the tool recognizes Windows, old Mac, and Unix-style line endings, so pasted text from any common source splits into lines correctly.

Can I use this for numbering a list, not just code?

Yes - with "Skip numbering blank lines" checked, it works well for numbering list items separated by blank lines, since only the content lines get a number.

Is there a limit to how much text I can number at once?

No practical limit - paste in as much text as you need; the numbering runs instantly regardless of length.

Lebih banyak di Content & Writing Tools