Add a Prefix or Suffix to Every Line — Quote, Number, Wrap, Join

Put text before and after each line, number them, and join them into one string — quote a list for SQL, bullet it, or wrap it in HTML tags in one step.

🔒 Runs in your browser — files never uploaded ⚡ No signup 💯 Free

Presets:

Use {n} in the prefix or suffix to place the line number yourself, e.g. item_{n}:. In the joiner, \n is a line break.

Add the same text to the start and end of every line at once. Quote a list of values for a SQL IN (…) clause, turn lines into bullet points or <li> items, prefix file paths, number the lines, or join everything into a single comma-separated string. Presets cover the common jobs; the fields handle everything else, and the result updates as you type.

How to use Add Prefix & Suffix to Lines

  1. Paste the lines.
  2. Pick a preset or type your own prefix and suffix. Use {n} where you want the line number.
  3. Join the lines with a separator if you need one string instead of many lines.
  4. Copy.

The jobs this replaces

  • SQL and code lists — a column of IDs from a spreadsheet becomes 'a', 'b', 'c' ready for an IN clause or an array literal. Choose single or double quotes and a comma joiner.
  • Markdown and HTML — prefix - for bullets, 1. via numbering, or wrap with <li></li>; wrap with <option> for a select list.
  • Paths and URLs — prefix a folder or a domain onto a list of file names; suffix an extension or a query string.
  • Test data and commands — turn a list into shell commands (curl -O prefix) or config lines.

Numbering

Tick "number lines" for a 1. prefix, or put {n} anywhere in your own prefix or suffix — image_{n}.jpg, [{n}]. Set the starting number (0 or 1 are the usual choices) and pad to a fixed width so files sort correctly: 001, 002… Blank lines are skipped by default and do not consume a number.

Joining

"Join lines with" collapses the result into one string: , for a list, \n for a line break (useful with a prefix that itself contains text), | for a table row. Combined with quoting, this is the one-step way to get from a column of values to something a query or a function call accepts.

To do the reverse — split one line into many — use find & replace with a regular expression; to remove the breaks entirely, remove line breaks.

Frequently asked questions

How do I quote a list for a SQL IN clause?

Paste one value per line, pick the "'quoted', list" preset — single-quote prefix and suffix, joined with a comma and space — and copy. For double quotes use the other preset. Values containing quotes still need escaping by hand.

How do I number the lines?

Tick "number lines" for 1. before each line, or put {n} in your own prefix or suffix (file_{n}.txt). Choose the starting number and pad the digits for files that must sort correctly.

What happens to blank lines?

By default they are skipped — no prefix, no suffix, no number — and kept as blank lines in the output (or dropped when joining). Untick "skip blank lines" to decorate them too.

Can I add a line break inside the joiner?

Yes: type \n in the joiner field for a line break and \t for a tab.

Does it handle Windows line endings?

Yes. CRLF and LF are both treated as line breaks; the output uses plain LF, which every editor accepts.