Home › Text Manipulation › Add Prefix & Suffix

Add Prefix & Suffix

Add characters at the beginning and/or end of each line.

🔒 100% private ⚡ Instant results ∞ No limits
⌨ Paste your text → click the action button → copy result · 🔒 Browser-only — nothing is ever sent to servers
Real-world example: I had a list of 200 product SKUs that all needed to be wrapped in single quotes and separated by commas for an SQL IN() clause. I added a single quote as the prefix, a single quote as the suffix, applied it, then ran the output through Remove Line Breaks with "replace with comma" — the entire IN() value was ready in about 20 seconds.

💡 Common Use Cases

  • Add bullet points or dashes to list items
  • Wrap each line in HTML tags
  • Add file path prefixes to filenames
  • Append file extensions to a list of names

Add a prefix, suffix, or both to every line in seconds

You have a list of names. You need to wrap each one in quotes for a SQL IN clause. Or you have a list of URLs and need to add https:// in front of each. Or you have an outline that needs every line preceded by a bullet character. Doing this by hand is the kind of repetitive work that takes ten minutes and feels like an hour. This Add Prefix & Suffix tool does it instantly: paste your list, type the prefix you want on each line, type the suffix, click apply.

How to use it

Paste your list (one entry per line) into the editor. Type whatever should appear at the start of every line into the Prefix field. Type whatever should appear at the end of every line into the Suffix field. Either field can be left blank if you only need one side. Click Apply, and the tool rewrites every line accordingly. Copy the result and use it wherever you need it.

Powerful use cases

Building SQL queries. A list of 200 user IDs becomes a valid WHERE id IN (...) clause in one operation: wrap each line with the prefix ' and the suffix ',, then collapse to a single line. This kind of work would otherwise need a spreadsheet formula or a small script.

Generating HTML lists. Turn plain text lines into HTML <li> items by using <li> as the prefix and </li> as the suffix. Paste the result inside a <ul> and you have a clean unordered list.

Adding URL protocols. A list of domains like example.com, another.com becomes a list of full URLs by prefixing https://.

Generating Markdown lists. Add - as a prefix to convert plain text into a Markdown bulleted list. Add 1. , 2. , 3. in combination with our Add Line Numbers tool for a numbered list.

Wrapping every line in quotes. Useful for CSV preparation, JSON string arrays (combine with a trailing comma), and YAML lists.

Adding file extensions. Take a list of base filenames and turn them into .png, .jpg, or .txt files by appending the extension as a suffix.

Building API request payloads. If you have a list of object IDs and need to turn each into a JSON object snippet like {"id": "abc"}, the prefix/suffix combo gets you 90% of the way there.

Bulk file paths. Add a directory path as the prefix to convert a list of filenames into full absolute paths.

CSS class generation. Add a common prefix to a list of component names to generate a list of BEM-style class names.

Tips and tricks

For more complex per-line transformations — like adding a different prefix to each line, or inserting a sequence number — combine this tool with Add Line Numbers or Find & Replace. The output of one tool can be the input of the next.

To wrap each line in quotation marks for use as a JavaScript or Python string array, use " as both the prefix and suffix, then run our Remove Line Breaks tool to flatten to a single line, joining lines with , .

The tool does not strip existing whitespace from the start or end of your lines. If your input has leading or trailing spaces you want gone, run Remove Extra Spaces first.

Special characters in your prefix or suffix — like tabs, newlines, or unicode symbols — are inserted exactly as typed. Copy and paste any character you need directly into the field.

What this tool does not do

It does not add a prefix or suffix to the entire block of text — only to each line individually. If you want to wrap the whole text in opening and closing tags, you can simply concatenate the prefix and suffix manually. It also does not transform content within a line; for that you would want Find & Replace.

Privacy

The whole operation runs in your browser using JavaScript string manipulation. Your text, your prefix, and your suffix never leave your computer. There is no server-side processing, no data logging, and no upload at any point. That makes the tool perfectly safe for any text — proprietary data, user IDs from a production database, customer email lists, or anything else you would not want sitting on a stranger's server.

❓ Frequently Asked Questions

An add prefix and suffix tool is an online utility that adds custom text before and after each line of your input text.
Yes. You can paste your multiline text and instantly add a prefix, suffix, or both to every line.
Yes. You can add only a prefix before each line and leave the suffix field empty.
Yes. You can add only a suffix after each line and leave the prefix field empty.
Yes. You can add quotation marks as both prefix and suffix to wrap every line in quotes.
Yes. You can wrap each line with single quotes and add commas to prepare SQL values quickly.
Yes. Add &lt;li&gt; as the prefix and &lt;/li&gt; as the suffix to convert lines into HTML list items.
Yes. The tool is completely free to use with no signup required.
Yes. All text processing happens directly inside your browser, and your content is not uploaded to servers.
Yes. The Add Prefix and Suffix tool works on desktop, tablet, and mobile devices.