Skip to main content
Premier SEO Services

Text tools

Add Prefix and Suffix to Each Line

Add the same text to the start and end of every line at once, for example to wrap a list in quotes, build an SQL value list or turn URLs into HTML links.

  • Runs in your browser
  • Free, no sign-up
  • Unlimited use
  • Updated 30 September 2026

Add Prefix and Suffix to Each Line

Paste your text — the result updates as you type

How to use the add prefix and suffix to each line

  1. 1Paste your list into Lines to change, one item per line.
  2. 2Under Add, choose a ready-made format such as Double quotes and a comma, or keep My own prefix and suffix and type into Prefix and Suffix.
  3. 3Leave Skip empty lines and Trim spaces at line ends first ticked unless you need blank lines or spaces changed too.
  4. 4Press Copy or Download to take the result.

Example

Input
red
green

blue 
Output
"red",
"green",

"blue"

Setting: Add = Double quotes and a comma. The trailing space after “blue” is trimmed, the empty line is skipped, and the last line gets no comma because No comma after the last line is ticked.

Adding a prefix to every line

Type the text you want in front of each line into Prefix. It is added exactly as typed, so include a trailing space if you want one, as in - for a bullet. Type \t for a tab.

Common prefixes: https:// to turn a list of domains into URLs, site: to build search operators, # to turn words into hashtags, and > to quote lines in an email or Markdown.

Adding a suffix to every line

The suffix goes after the last character of each line. With Trim spaces at line ends first ticked, invisible trailing spaces from spreadsheets are removed first, so the suffix sits right after the text. Typical suffixes are , for comma-separated values, ; for statements, .com for domain ideas, or near me for keyword variations.

Use prefix and suffix together: prefix <option> with suffix </option> turns a list into the options of an HTML select box.

Recipes: quotes, commas, HTML tags

Choice under Addapple becomes
Double quotes and a comma"apple",
Single quotes and a comma (SQL)'apple',
HTML list items<li>apple</li>
HTML links<a href="apple">apple</a>
Markdown bullets- apple

The SQL format doubles any apostrophe inside a line (O'Neil becomes 'O''Neil',), which is how SQL escapes quotes. Wrap the result in IN ( … ) to use it in a query. No comma after the last line leaves the final item without a trailing comma, which some languages and SQL dialects reject.

Empty lines and whitespace

Blank lines are left alone by default so the layout of your text stays the same; untick Skip empty lines to give them a prefix and suffix too. A line that contains only spaces counts as empty. Windows (CRLF) line endings are converted first, so a suffix never lands after a hidden carriage return, a common cause of broken CSV and SQL lists.

Is my text private?

This tool runs entirely in your browser. Your text is not uploaded to our servers.

Questions about the add prefix and suffix to each line

How do I add quotes around each line?

Choose Double quotes and a comma under Add, or keep My own prefix and suffix and type " into both Prefix and Suffix if you don't want commas.

Can I skip empty lines?

Yes, that is the default. Untick Skip empty lines if every line, including blank ones, should get the prefix and suffix.

How do I turn a list into a comma-separated list?

Join the lines with join / merge text and choose a comma as the separator, or add a comma suffix here and then remove the line breaks.

Last updated 30 September 2026Maintained by Premier SEO Services

Report a problem