Add prefix and suffix to lines online Tool

Add the same text to the start or end of every line at once. Wrap a list in quotes, add commas, build HTML tags, or comment out a block of code. Everything runs in your browser, so your text stays on your device.

0lines0characters
Result
0lines0characters

About adding a prefix or suffix

What does this tool do?

This tool takes a list of lines and adds the same text to every one of them in a single step. The prefix goes at the start of each line and the suffix goes at the end, so you can wrap a plain list in quotes, brackets, or HTML tags, add a trailing comma, or bolt on a repeating label. Doing this by hand across dozens or hundreds of lines is slow and easy to get wrong. Here you type the text once and every line is updated together.

Why use our prefix and suffix tool

  • ·Free. No signup, no paywall, no limits.
  • ·Both sides at once. Add a prefix, a suffix, or wrap each line on both ends together.
  • ·Runs in your browser. Nothing gets uploaded, your text stays with you.
  • ·Handles blank lines. Skip empty lines by default, or include them if you need to.
  • ·No limit. Paste a short list or thousands of lines, it keeps up.

Common ways to use it

Wrap values in quotes

Set both the prefix and suffix to a quotation mark to turn a plain list into quoted strings, ready to drop into code or a spreadsheet.

Prefix"Suffix"
Beforeapple banana cherryAfter"apple" "banana" "cherry"

Build an HTML list

Add an opening list tag as the prefix and a closing tag as the suffix to turn each line into a list item without touching the markup by hand.

Prefix<li>Suffix</li>
BeforeHome About ContactAfter<li>Home</li> <li>About</li> <li>Contact</li>

Add SQL values or commas

Wrap each line in parentheses and end it with a comma to draft an insert statement, or just add a trailing comma to build a quick array.

Prefix('Suffix'),
Beforered green blueAfter('red'), ('green'), ('blue'),

Comment out lines

Use a prefix like a hash or two slashes to comment out every line at once, useful when you want to disable a block of config or code.

Prefix# Suffix
Beforeserver=on debug=trueAfter# server=on # debug=true

Who uses a prefix and suffix tool

Any time the same text needs to repeat on every line, this tool saves a lot of slow, repetitive editing. Here are the most common reasons people use it:

  • ·Developers. Wrapping values in quotes, adding commas for arrays, drafting SQL rows, or commenting out a block of code line by line.
  • ·Writers and bloggers. Turning a plain list into Markdown bullets or numbered points, or adding a repeating label to each line.
  • ·Marketers and SEO teams. Prefixing a batch of URL slugs with a folder path, or wrapping keywords for a bulk upload.
  • ·Data and spreadsheet work. Building CSV fields, adding quotes and commas, or shaping a column of values before an import.
  • ·Anyone cleaning up a list. Adding brackets, tags, or symbols to a set of names, emails, or line items without editing each one.

Frequently asked questions

How do I add a prefix or suffix to every line?
Paste your list into the box, type the text you want in the Prefix field, the Suffix field, or both, then click Add to each line. The prefix goes at the start of every line and the suffix goes at the end. Copy the result or download it as a .txt file.
Can I add text to the start and end at the same time?
Yes. Fill in both the prefix and the suffix and each line gets wrapped on both sides in a single pass. This is the quick way to put quotes, brackets, or HTML tags around every line at once.
Does it change blank lines?
By default, blank lines are left alone so your spacing stays intact. If you would rather add the prefix and suffix to empty lines too, turn off the 'Skip empty lines' option.
What does 'Trim lines first' do?
It removes any leading and trailing spaces from each line before the prefix and suffix are added. That keeps the output clean when your pasted text has uneven indentation, which is common with copied code or exported data.
Is there a limit on how many lines I can process?
No. You can paste a handful of lines or many thousands and the tool handles them instantly. Because everything runs on your own device, there is no upload cap and no waiting on a server.
Can I use it to build code, CSV rows, or Markdown?
Yes. It is popular for wrapping values in quotes, adding commas for arrays and SQL, turning lines into HTML list items or Markdown bullets, and commenting out blocks of code. Anything that repeats the same text on every line is a good fit.
Is the tool free?
Yes, it is completely free with no signup, no limits, and no watermarks. Use it as often as you like.
Is my text safe and private?
Your text never leaves your browser. All processing runs locally on your device, so nothing is uploaded to a server. Once the page has loaded you can even use it offline.