Add prefix and suffix to each line

Puts text at the start and end of every line — quotes, bullets, tags, commas.

Type what you want before each line, what you want after it, or both, then press the button. Every line gets the same treatment; the order and the content of the lines are untouched.

Presets people reach for most

You can type anything into the two fields, but these are the combinations that come up again and again. Copy them straight in.

Empty lines

By default empty lines are skipped, because adding <li></li> to a blank line produces an empty list item that then shows up in your page. Untick the option if you genuinely want every line touched, including blank ones — occasionally useful when the prefix is a comment marker and you want the blank lines commented too.

Order of operations

If your list came out of a spreadsheet or a PDF, run trim spaces before adding a prefix. Otherwise an invisible leading space ends up between your prefix and the text, which is exactly the kind of bug that survives review and breaks a query at 2am. The trim button on this page does it without leaving.

If you are going to join the lines into one comma-separated string afterwards, you usually do not need a suffix at all — the list converter adds the separators for you and does not leave a trailing comma on the last item, which the prefix/suffix approach does.

Doing it without this tool

Excel: ="prefix"&A1&"suffix" in a helper column, filled down, then copy and paste-special as values. Fine for a spreadsheet you are already in, awkward for text you are not.

Notepad++ or VS Code: Find & Replace with regular expressions on: search ^ and replace with your prefix, then search $ and replace with your suffix. Both editors also support column selection (Alt+drag), which lets you type a prefix into many lines at once — quick when the lines are visible on one screen, painful when there are four thousand of them.

Command line: sed 's/^/prefix/; s/$/suffix/' file.txt.

Word: use Find & Replace with "Use wildcards", searching for (*)^13. Most people give up and do it by hand, which is how the same typo ends up on line 40 and line 41.

Try:
0Words
0Characters
0No spaces
0Sentences
0Paragraphs
0Lines
0Pages
0Reading
0Speaking

Runs entirely in your browser. Your text is never uploaded — open DevTools, Network tab, and you will see zero requests while you use this tool.

How to use it

  1. Paste your list into the box.
  2. Type the text you want before each line into the Prefix field, and the text you want after it into Suffix.
  3. Press "Apply to each line".
  4. For a quoted, comma-separated list use "Wrap in quotes + commas" instead — it escapes quotes for you.

Related tools

Compare two listsFinds what is only in list A, only in B, in both, or different between them.Column ↔ comma listTurns lines into one separated string — and back again.Join linesMerges every line into a single line with the separator you choose.Truncate textShortens each line to a maximum length, optionally without cutting a word.Magic 8 ballAsk a yes or no question. The ball answers.Upside down textFlip a line so it reads the other way up. Copy and paste anywhere.Remove duplicates in ExcelThree apps, four methods, and the one setting that silently deletes the wrong…

See all text tools →

Frequently asked questions

Can I add only a prefix, without a suffix?

Yes. Leave the other field empty. The same works the other way round for a suffix only.

Does it add the prefix to blank lines?

Not by default — blank lines are skipped so you do not get empty list items or stray markers. Untick "Skip empty lines" if you want them included.

How do I wrap every line in quotes for SQL or JSON?

Use the "Wrap in quotes + commas" button. It adds double quotes, escapes any quotes already inside the line and puts a comma at the end of each line but not after the last one.

Can I add line numbers this way?

No — the prefix is the same on every line. Use the add line numbers tool, which counts and supports formats like 1. or 01) and custom starting values.

Will it work with tabs or special characters?

Yes, anything you can type or paste into the field is used literally, including tabs, brackets and HTML.