How to add prefix and suffix to each line
Add suffix to the following words: a copyable sample
What the skip empty option does
Features explained
Add prefix to every line
The prefix text is put at the start of each line. It is added exactly as you type it, so spaces are kept.
Add suffix to every line
The suffix text is put at the end of each line, exactly as you type it.
Skip empty lines
Turn this on to leave empty lines, and lines with only spaces, unchanged. It is off by default.
Load example
Fills the tool with sample text so you can see how it works before using your own.
Copy and download
Copy the result to your clipboard in one click, or download it. The copy button shows Copied! when done.
Clear
Resets the tool so you can start again with new text.
What can you use it for?
Add prefix or suffix to lines online
Put the same start or end on every line of a list, such as a dash, a number sign or a word.
Quote and separate items
Wrap each item with quotes by using one as prefix and one as suffix, or add a comma or semicolon at the end of each line.
Names, links and codes
Put a fixed beginning, such as a domain or folder name, in front of each name, and a fixed ending after it.
Keyword lists
Add the same words before or after every keyword in a list when you prepare content or data.
Tool information
| Tool type | Add prefix and suffix to each line |
|---|---|
| Options | Prefix, Suffix, Skip empty lines |
| Default values | Prefix: empty, Suffix: empty, Skip empty: off |
| Works on | Each line of the input text |
| Output | The changed lines, joined with line breaks |
| Spaces | Prefix and suffix are added exactly as typed |
| Processing | In your browser, using JavaScript |
Benefits
- One prefix and one suffix are applied to the whole list in one step.
- Skip empty keeps blank lines between groups untouched.
- Prefix and suffix are added exactly as you type them, so you control every space.
- The tool code we checked makes no network request for your text.
Limitations
- The same prefix and the same suffix are used for every line. The tool does not number lines or change them line by line.
- It adds text to the start and end only. It does not change the text inside a line.
- No space is added for you. If you want a space after the prefix or before the suffix, type it in the option.
- Always check the result before you use it in important work.
Your text stays in the page
Processing runs in this page using JavaScript. The tool code we checked does not send your text to a server. Still, do not paste confidential text on a shared or public device.
Tips
- Click Load example first to see how the tool works.
- To get '- item', type a dash and then a space in the prefix option.
- If blank lines in your text should stay blank, turn on skip empty.
- Put one word or item on each line before you start.
Frequently asked questions
How do I add a prefix or suffix to lines online?
Paste your text with one item per line, type the prefix and the suffix, and read the result. Every line gets both. Then copy or download the result.
How do I add a prefix and suffix online to each word?
Put each word on its own line, then enter the prefix and the suffix. The tool works on lines, so one word per line gives each word its own prefix and suffix.
How do I add a suffix to the following words?
Paste the words with one on each line, leave the prefix empty, and type the ending in the suffix option.
What does skip empty do?
When it is on, empty lines and lines with only spaces are left unchanged. When it is off, which is the default, they also get the prefix and suffix.
Why does my empty line show a prefix and suffix?
Skip empty is off by default, so empty lines are changed too. Turn it on to leave them alone.
Does the tool add spaces for me?
No. The prefix and suffix are added exactly as you type them. Type a space in the option if you want one.
Is my text sent to a server?
Processing runs in the page using JavaScript, and the tool code we checked makes no network request for your text. Do not paste confidential text on a shared device.