The Add Prefix and Suffix to Lines tool adds the same text to the start and/or the end of every line in one click. Paste a list, type a prefix like - or " and a suffix like , or ", and copy the result.
It’s free, needs no sign-up and runs entirely in your browser, so your text is never uploaded.
Spaces count, so type a space after the prefix or before the suffix if you want one. Leave a box empty to add only the other one.
How to Use the Add Prefix and Suffix Tool
- Paste your text into the box, with one item on each line.
- Type a prefix to add to the start of every line, a suffix to add to the end, or both.
- Choose your options: skip empty lines so blank lines stay blank, and trim extra spaces from each line.
- Press “Add prefix and suffix,” then copy the result. If you change the prefix, suffix or an option afterward, the result updates on its own.
Example
With the prefix ", the suffix ", and “Skip empty lines” turned on, this list:
apple banana cherry
becomes:
"apple", "banana", "cherry",
Want a bulleted list instead? Use - (a dash and a space) as the prefix and leave the suffix empty.
Options Explained
- Prefix: the text added to the start of each line. Spaces count, so “- ” and “-” give different results.
- Suffix: the text added to the end of each line, such as a comma, a period, a closing quote or a file extension.
- Skip empty lines: blank lines (including lines with only spaces) are left as they are, so you don’t end up with empty quotes or lonely bullets. Turn it off to wrap every line.
- Trim spaces: removes spaces and tabs from the start and end of each line before the prefix and suffix are added, which keeps the result tidy.
When to Add a Prefix or Suffix to Every Line
- Lists and notes: turn plain lines into a bulleted list with “- ” or “• “.
- Quotes and commas: wrap words in quotes and add commas to build a list for a spreadsheet, a form or code.
- Hashtags and mentions: add “#” or “@” in front of a list of words or usernames.
- URLs and file names: add a website address in front of a list of page paths, or “.jpg” to the end of a list of image names.
- Code and comments: add “// ” or “# ” to comment out many lines at once, or wrap values for a database query.
- Emails and messages: add “> ” to quote someone’s lines, or the same greeting to a list of names.
Frequently Asked Questions
How do I add text to the beginning and end of every line?
Paste your lines into the box above, type the text you want at the start in “Prefix” and at the end in “Suffix,” and press “Add prefix and suffix.” Every line gets both, and you can copy the result with one click.
Can I add only a prefix or only a suffix?
Yes. Leave the other box empty. For example, type “- ” as the prefix and nothing as the suffix to make a simple bulleted list.
What happens to blank lines?
With “Skip empty lines” turned on (the default), blank lines stay blank and keep your groups separated. Turn it off if you want the prefix and suffix on every line, even empty ones.
Does the tool change the order of my lines?
No. Your lines stay in the same order. Only the prefix and suffix are added, plus trimming if you turn it on.
Can I use symbols, quotes or spaces?
Yes. Anything you type is added exactly as written, including spaces, quotes, brackets, emojis and symbols.
Is my text saved or uploaded?
No. Everything happens in your browser, and your text is never sent to a server.
Related Tools
- Add Line Numbers: put a number in front of every line instead.
- Plain Text Converter: clean up formatted text before you add a prefix or suffix.
- Remove Line Breaks: join lines back into one paragraph.
- Remove Duplicate Lines: delete repeated lines from your list first.
- Browse all of our free word tools.