Use the free Add Prefix and Suffix to Lines below: your data never leaves your browser — all work happens on your device, and nothing is uploaded to any server.
Why wrap every line
Many everyday tasks come down to putting the same text around every line of a list. A list of names becomes a list of quoted strings for code. A list of words becomes HTML list items. A list of file names becomes a series of commands. A list of values becomes rows for a query. Doing it by hand means editing each line twice, once at the start and once at the end, and in a long list that is dozens of tiny edits where a typo can hide.
Wrapping all lines at once turns that chore into a single step. You type the prefix once, the suffix once, and every line gets both, consistently, with no missed lines and no typos creeping into the repeated text.
How this tool works
Paste your lines, one per line, then type the prefix and the suffix. The tool puts the prefix at the start of each line and the suffix at the end, and joins the lines back together. The default example wraps lines in double quotes with a trailing comma, which is the shape of a list of strings in many programming languages, but you can use anything: angle brackets, parentheses, square brackets, HTML tags, comment markers, or a bullet and a full stop.
Empty lines are skipped by default, so a blank line between groups does not gain a stray pair of quotes or tags. Turn that off if you want every line wrapped, including blank ones, which matters when the line count itself must be preserved, for example when wrapping lines to match another file line for line. The original line content is never altered: the tool only adds text around it.
When to use it
Use it to turn a plain list into code: quoted strings, array elements, function calls, or import lines. Use it to turn items into HTML: wrap each line in list-item tags, or add a paragraph tag around each one. Use it to prepare data: add quotes and commas for a spreadsheet import, or add a command prefix to each file name for a batch script. Writers use it to add a marker to every line of a draft, such as a quote character for a block quote, or a dash for a checklist.
It also pairs well with the other line tools. Strip bullets or numbers first, then wrap the clean lines; or wrap first and then indent the whole block. Building a transformation as a short sequence of simple steps is more reliable than trying to do everything in one complicated pass.
What wrapping does not do
Wrapping is literal: it does not escape characters inside your lines, so if a line itself contains a double quote and you wrap with double quotes, the result will contain an unescaped quote in the middle. For code that must be valid, check lines for the wrapping characters first, or choose wrapping characters that do not appear in your data. The tool also does not split or join lines: one input line always becomes one output line, however long it is.
Also note that the same prefix and suffix apply to every line. If different lines need different wrappers, split the text into groups first, wrap each group separately, and join them back together. That keeps each step simple and checkable.
Tips for wrapping lists
Try the wrap on a few lines before running a huge list, and check the first and last lines carefully, since those are where a missing comma or bracket is most likely to matter. If you wrap with HTML tags, remember the closing tag goes in the suffix, not the prefix, and the pair must match. And as always, the tool runs entirely in your browser: your lists and code never leave your device.
