What this tool does
Add Prefix & Suffix takes a list of lines and prepends a string to the start and/or appends a string to the end of every line. It's the simplest text-transformation tool on the site, and one of the most useful, almost every "wrap each item in X" job is one prefix and one suffix away.
Type your text into the input editor, drop a value into the Prefix and/or Suffix fields, and watch the output update on every keystroke. Toggle Skip empty lines to leave blank lines untouched (default: on, because adding <li></li> to an empty line is rarely what you want).
How to use it
1. Paste your list, one item per line. 2. Type into the Prefix field whatever should appear at the start of each line. 3. Type into the Suffix field whatever should appear at the end of each line. 4. Copy the output, or hit Download for a .txt file.
That's the whole tool. The status line below the editors shows how many lines were modified, the total output size, and how long the run took (essentially zero, the operation is a single split + map + join).
Things people use this for
Most "I need to bulk-format this list" tasks reduce to one prefix and one suffix. A few common ones:
- HTML list items, prefix
<li>, suffix</li>. Then wrap the whole output in<ul>…</ul>. - SQL
IN ()clauses, prefix', suffix',. Drop the trailing comma manually. - Markdown bullet lists, prefix
-, suffix nothing. - Markdown numbered lists, prefix
1.(Markdown auto-renumbers, so every line can literally be1.). - YAML array items, prefix
-, suffix nothing. - JSON string array, prefix
", suffix",. Then wrap with[…]and remove the final comma. - CSV column wrapping, prefix
", suffix". Combine with a separator pass for full quoting. - Shell commands per line, prefix
curl -X POST, suffix&& echo done. - Python list literals, prefix
", suffix",. Indent + quote in one pass. - Comment every line, prefix
//or#to disable a block of code without manually visiting each line.
Skip empty lines, and why it's the default
Lots of pasted lists have stray blank lines between groups. Without the skip, those blanks become <li></li> or - , visible empty bullets that you'd have to clean up afterwards. Skip empty lines means a line consisting only of whitespace is passed through unchanged, preserving the visual grouping in the output. Turn the toggle off if you actually want to wrap whitespace-only lines (rare, but valid for fixed-width formatting).
What this tool deliberately does not do
- Per-line transformations beyond prefix/suffix. If you need to also lowercase, trim, or substring each line, run the output through Case Converter or Find & Replace first.
- Counter substitution. This tool doesn't expand
{i}to a 1-based line number. For numbered lists in plain text, paste the output into a tool that handles numbering, or use Markdown's auto-renumbering. - Conditional prefixes. Every non-skipped line gets the same prefix and suffix. If you need "prefix X for lines starting with foo, prefix Y otherwise", that's a Find & Replace job, not a prefix/suffix job.
Common gotchas
- Trailing comma in arrays. When you build a JSON or SQL array by adding a
,suffix, the last line will also end with a comma. Strict JSON parsers reject trailing commas; SQL doesn't care. Manually remove the last comma, or add it as a separator instead. - Escaping inside the prefix/suffix. The fields take literal characters, not regex or template syntax. A literal
\nin the suffix appears as the two characters backslash-n, not a newline. - Tab characters. Pasting a tab into the prefix field works, tab-separated output is fine. But many browsers map
Tabto the next focusable element instead of inserting a literal tab. Copy a tab from your editor instead. - Very long inputs. The tool handles tens of thousands of lines easily; the bottleneck is the browser textarea's render performance, not the transformation.
Privacy
The input, the prefix and suffix you type, and the output all stay in your browser. Nothing is uploaded to any server. Recent inputs are saved in your browser's local storage and can be cleared from the "Recent" card.