Add Prefix and Suffix to Each Line

Append a prefix and/or suffix to every line of a list at once. Perfect for building HTML, SQL, CSV and formatted lists.

What this tool does

This tool adds text to the beginning and/or end of every line in your list at once. Type a prefix, a suffix, or both, and the tool wraps each line accordingly. It is the fast way to turn a plain list into formatted output — building HTML tags, SQL values, CSV rows, quoted strings, or any repetitive structure where each line needs the same wrapper.

Why it saves so much time

Adding the same characters to hundreds of lines by hand is slow and error-prone. With this tool, a column of names becomes a set of HTML list items, a list of values becomes a SQL IN clause, or a set of words becomes quoted, comma-separated entries — all in one step. What would be a tedious manual edit or a script you would have to write becomes instant.

Common patterns

Wrap each line in an HTML tag by using a prefix of "<li>" and a suffix of "</li>." Quote each value with a prefix and suffix of a quotation mark. Build a Markdown list with a prefix of "- ". Add a trailing comma to each line to prepare data for code. Prefix each URL with a base path. The optional "skip empty lines" setting leaves blank lines untouched so you do not wrap nothing.

Pairs well with other tools

Combine this with Remove Duplicate Lines to clean a list first, or with Sort Lines to order it before wrapping. For data work, prefix and suffix is often the last step that turns cleaned text into ready-to-paste code or markup. Everything runs in your browser, so even internal data stays private.

Adding text to every line at once

This tool wraps every line of a list with text you specify before (prefix) and after (suffix). It turns a plain list into formatted output in one step. Add quotation marks and commas to turn a column of values into a code array. Wrap each line in HTML tags to build a list. Prepend a path to every filename. Append a units label to every number. Anything that needs the same text added to the start or end of many lines is instant here, instead of editing each line by hand.

Building code, HTML, SQL and CSV

Developers and analysts use this constantly to reshape data into code. Paste a column of IDs, add a prefix of an opening quote and a suffix of a closing quote and comma, and you have a ready-to-paste array. Wrap each value in an HTML <li> and </li> to build a list. Turn a list of values into a SQL IN clause. Add a column delimiter to build CSV rows. Because the prefix and suffix apply to every line at once, reformatting hundreds of rows takes seconds.

Skipping empty lines

By default the tool can skip blank lines, so you do not end up wrapping nothing and creating lines that contain only your prefix and suffix. This keeps the output clean when your source list has gaps. Turn the option off if you actually want every line wrapped, blanks included. Combined with the Number Lines tool, you can produce richly formatted output — numbered, wrapped and labeled — from a plain list in a couple of steps.

Frequently asked questions

Can I add both a prefix and a suffix at once?
Yes. Fill in both fields and each line gets the prefix at the start and the suffix at the end in a single operation. You can also use just one.
Does it add the text to empty lines too?
By default, the "skip empty lines" option leaves blank lines untouched so you do not wrap empty content. Turn it off if you want every line wrapped regardless.
What can I build with it?
HTML tags around each item, quoted and comma-separated values for code, SQL IN clauses, Markdown list items, trailing commas for data, or base paths in front of URLs — any repetitive per-line wrapper.
Is there a line limit?
Only your browser's memory. Lists of thousands of lines process instantly.
Is my data uploaded?
No. Everything runs in your browser, so internal data stays on your device.
What is a prefix and a suffix?
A prefix is text added to the start of each line; a suffix is text added to the end. For example, with prefix "<li>" and suffix "</li>," each line becomes an HTML list item.
Can I use this to build a code array or SQL list?
Yes. Add an opening quote as the prefix and a closing quote plus comma as the suffix to turn a column of values into an array or a SQL IN list, ready to paste into your code.
Will it add the prefix and suffix to blank lines?
Only if you want it to. By default empty lines can be skipped so you do not create lines containing just the prefix and suffix. Toggle the option to include or exclude blanks.