Skip to content

Text

Line Prefix & Suffix

Line Prefix & Suffix

Beta

Add a prefix, a suffix, or line numbers to every line of a text. Start at any number, step by any amount, pad with zeros, and skip blank lines. Runs in your browser, no signup.

Use via API
  • Free, no sign-up
  • REST + MCP
  • Updated
  • Reviewed by Olgun Ozoktas

Options

Lines: 0

Lines changed: 0 / 0

How to add line numbers, a prefix, or a suffix

  1. Paste the lines

    Paste the text into the Input box, one item per line, or click Load sample. The result appears in the output box at once.
  2. Set the prefix and suffix

    Type the text to add at the start of each line in Prefix and the text to add at the end in Suffix. Leave either empty to add nothing there.
  3. Choose the numbering

    Keep Number the lines on for a numbered list. Set Start at, Step, and the Number format, and turn on Pad with zeros for aligned numbers.
  4. Copy the result

    Click Copy to put the result on your clipboard, then paste it into your document, code, or spreadsheet.

Common use cases

Markdown lists

Add "- " to every line for a bullet list or number the lines for an ordered list without typing each marker.

SQL and JSON values

Wrap each line in quotes and end it with a comma to turn a column of values into an IN list or a JSON array.

Scripts and transcripts

Number the lines of a screenplay, a transcript, or a code sample so reviewers can refer to a line by its number.

Bulk file names and paths

Prepend a folder path or append a file extension to a list of names before you paste them into a script.

Why use a line prefix and suffix tool?

A list often needs the same small change on every line: a dash in front to make Markdown bullets, a comma at the end to build a SQL IN list, quotes around each value for a JSON array, or a running number for a numbered list, a script, or a transcript. Doing that by hand on a hundred lines is slow and error-prone, and a spreadsheet formula is more work than the job deserves. This tool applies one prefix, one suffix, and an optional line number to every line in one pass and shows how many lines changed.

The Line Prefix & Suffix tool applies the same small edit to every line of a text: a prefix at the start, a suffix at the end, and an optional line number ahead of both. Numbering starts at any whole number, steps by any amount, follows a format you type with {n} as the placeholder, and pads with zeros on request. Blank lines can be skipped so a paragraph break neither changes nor consumes a number.

The function is the same one behind the REST tool line-prefix-suffix and the MCP tool line_prefix_suffix, so a script or an AI client produces exactly what the page shows. The page adds a counter for the lines changed and a sample to try.

Pair it with the Text Line Sorter to order the lines first, the Duplicate Line Remover to drop repeats, and Find & Replace to edit text inside the lines.

How it compares

A text editor with multi-cursor support can add a prefix to every line, and a spreadsheet can do it with a concatenation formula, but numbering with a custom format, zero padding, and blank-line handling takes a macro or a script in both. A dedicated tool makes those five options explicit fields and shows the result as you type.

Compared with other online line tools, this one does one job and states it: it never sorts, dedupes, or edits the middle of a line. It runs in your browser rather than on a server and offers the same function through a REST endpoint and an MCP server for automation.

Tips

  • Sort or dedupe the lines first with the Text Line Sorter or the Duplicate Line Remover, so the numbering stays clean.
  • Use "{n}\t" as the number format to separate numbers from text with a tab. Spreadsheets split that into two columns on paste.
  • Turn Pad with zeros on for file names. 01 to 12 sorts correctly in every file manager; 1 to 12 does not.
  • Leave Skip blank lines on for prose. Paragraph breaks keep their place and do not consume a number.
  • Watch the Lines changed counter. It tells you how many lines received the prefix, suffix, or number.

Frequently Asked Questions

What order do the number, prefix, and suffix take?

The line number comes first, then the prefix, then the original line, then the suffix. With a prefix of "- " and numbering on, a line reads "1. - item". Turn numbering off when you want only the bullet.

How do I change the number style?

Edit the Number format field. The placeholder {n} is replaced by the number, and the rest is kept as typed. "{n}. " gives "1. ", "{n}) " gives "1) ", "[{n}] " gives "[1] ", and "{n}\t" puts a tab after the number.

Can I start at zero or at a large number?

Yes. Start at accepts any whole number, including zero and negative values. Step sets the increment, so a start of 10 and a step of 10 gives 10, 20, 30.

What does Pad with zeros do?

It pads every number to the width of the last number. A list of 120 lines gets 001 to 120, so the numbers line up in a monospace editor and sort correctly as text.

How are blank lines handled?

With Skip blank lines on, a line that holds only whitespace is left as it is and does not consume a number. With it off, the blank line gets the prefix, suffix, and number like any other line.

Does the Line Prefix & Suffix tool require a signup?

No. It is available with no signup and no usage limits. The processing runs in your browser, so the text you paste is not uploaded to a server.

Can I run the same operation from a script or an AI client?

Yes. The same function powers the REST tool line-prefix-suffix at api.findutils.com and the MCP tool line_prefix_suffix at mcp.findutils.com. The arguments are text, prefix, suffix, number_lines, start_at, step, number_format, pad_numbers, and skip_blank.

How do I wrap each line in quotes?

Set the prefix to a quote mark and the suffix to a quote mark followed by a comma. Each line becomes "value", ready to paste into a JSON array or a SQL IN list. Remove the last comma by hand.

Does it change the text inside the lines?

No. The tool adds text at the start and the end of each line and never edits the middle. Use Find & Replace to change text inside a line.

Is there a size limit?

The page has no fixed limit; your browser's memory is the ceiling. The REST and MCP surfaces cap one request at 1 MB.

Rate This Tool

0/1000

Get Weekly Tools

Suggest a Tool