Add line numbers to text

Number the lines of a list, or add the same prefix and suffix to every line, for code listings, quotes and CSV preparation.

Add line numbers to text

0 characters

Three steps — nothing to install

  1. Paste the lines

    A list, a log excerpt, or text you are about to quote.

  2. Choose a style

    1. 2. 3., 1) [1], 01, or no number at all if you only need prefixes.

  3. Add a prefix or suffix

    A quote marker, a comma, a semicolon — the same text goes on every line.

Numbering styles and padding

Five number styles cover what people actually paste: 1. for prose, 1) for lists in documents, [1] for citations, bare 1 for data, and 01 for anything sorted alphabetically afterwards — without the leading zero, line 10 sorts before line 2.

The start number is editable, so a list that continues from an earlier page can begin at 11. Empty lines can be numbered or skipped; for a listing with paragraph gaps, skipping keeps the numbering aligned with the visible lines instead of counting the gaps.

Prefixes and suffixes that do real work

A prefix is added before the number, so > produces a Markdown blockquote on every line. A suffix is added at the end, which turns a list of values into a SQL IN list or a semicolon-terminated set of statements. Both are plain text, so nothing is escaped or interpreted.

With the number style set to no numbers, the prefix and suffix still apply, which makes the tool a general-purpose line decorator. That is the fastest way to quote a passage, comment out a block, or turn a column of values into a comma-separated list.

Line breaks and what counts as a line

Lines are split on any of the three line-ending conventions, so text from Windows, Unix and old Mac files all number correctly. A file that ends with a newline does not produce an extra empty numbered line, because the trailing empty string is not a line.

The numbering is written as text, not as an ordered list in HTML. That is deliberate: it survives being pasted into an email, a ticket, a README or a spreadsheet, where markup would be lost or rendered. If you need real list markup, use a Markdown list and a previewer instead.

Frequently asked questions

Can I start numbering at a number other than 1?Yes. Set the start value; the list continues from there for every line that is numbered.
Can I add 01, 02, 03?Yes. The 01 style pads to two digits, which keeps a numbered list sorting correctly as text.
Can I skip empty lines?Yes. Tick the option and empty lines stay unnumbered, so the numbers match the visible lines.
Can I add a prefix without numbers?Yes. Choose No numbers and set the prefix or suffix; every line gets it.
Is the text uploaded?No. The numbering is a string operation in this tab, with no network request.
Will existing numbers be removed?No. The tool adds to what is there; remove an existing numbering pass first with find and replace.