How to use add prefix and suffix
- Paste your lines into One item per line.
- Type the text to add before each line in Prefix and after each line in Suffix. Either can be left empty.
- Leave Leave empty lines alone ticked so blank lines stay blank. Untick it to wrap blank lines too.
- Copy the result.
What it does and when to use it
Adding the same text to dozens of lines by hand is slow and error-prone. Spreadsheet formulas and code editors can do it, but this tool is quicker for a one-off job. Some common prefix and suffix pairs:
| Goal | Prefix | Suffix |
|---|---|---|
| Quoted items for code | ' |
', |
| HTML list items | <li> |
</li> |
| Full links from page slugs | https://example.com/ |
(empty) |
| Markdown checklist | - [ ] |
(empty) |
| Hashtags from words | # |
(empty) |
| File names | (empty) | .jpg |
For bullets in several styles, text to bullet list has them ready-made, and text to numbered list adds counting numbers. To number lines with a fixed format, add line numbers is the right tool.
How it works
The text is split at line breaks. For each line the tool writes the prefix, then the line exactly as it was, then the suffix. When Leave empty lines alone is ticked, a line that is empty or holds only spaces is passed through unchanged. Lines are then joined back with line breaks. Nothing is trimmed, escaped or checked, so what you type is what you get. The work happens in your browser.
Worked examples
These outputs come from the tool’s own function.
The default code list. apple, banana, cherry with the default prefix ' and suffix ', give 'apple',, 'banana', and 'cherry',. Remove the last comma by hand if your language does not allow a trailing comma.
Full URLs. home and about with Prefix https://example.com/ and an empty Suffix give https://example.com/home and https://example.com/about.
HTML list items. first, an empty line and second, with <li> and </li>, give the two list items with the blank line still between them. With Leave empty lines alone unticked, the blank line becomes <li></li>.
Limits and tips
- The same prefix and suffix go on every line; there is no counter or per-line variable. Use the numbered list or line number tools for that.
- Characters such as & or quote marks inside your lines are not escaped for HTML, SQL or JSON. Check the result if the data is unusual.
Frequently asked questions
Why do the boxes already contain quote marks?
Can I add text only to the start, or only to the end?
Are spaces in the prefix and suffix kept?
Does it trim my lines first?
How do I put all the lines on one line afterwards?
How do we know nothing is uploaded? Test it yourself on the privacy proof page.