Prefix / Suffix Adder
Add a custom prefix and/or suffix to every line of text.
Lines: 0Characters: 0
Adding prefix and suffix to every line
This tool adds any text you want before and after each line — useful for wrapping list items in HTML tags (<li> / </li>), appending commas to build SQL IN-lists, adding Markdown bullet dashes, wrapping in quotes for CSV, or adding backticks for SQL identifiers. Use Add Line Numbers to prefix lines with sequential numbers, or Lines to Comma-Separated to join them in one step.
Built and maintained by Meet Shah · Last updated
What this tool is used for
- Wrapping every line of a list in quotes and a comma for a code literal.
- Adding a path prefix to a list of filenames.
- Turning a plain list into Markdown bullets by prefixing each line.
- Adding a comment marker to every line of a block.
- Appending a common domain to a list of usernames.
Frequently Asked Questions
- What is this actually useful for?
- Bulk-editing lists: turning bare values into quoted SQL literals, adding a path prefix to filenames, wrapping lines in HTML tags, or building a CSV column. It is the fastest way to reshape a list without a script.
- Are empty lines affected?
- Usually yes unless filtered, so a blank line becomes just the prefix and suffix — producing stray artefacts like empty quoted strings. Strip empties first if the output feeds a parser.
- Does it handle trailing whitespace?
- Not unless it trims first, which matters: a line with a trailing space gets the suffix after the space, so "value " becomes "value " rather than "value". Invisible and a common cause of failed lookups.
- How do I escape characters in the values?
- This tool wraps, it does not escape. If a value contains the same quote you are adding, the result is malformed — which is exactly why generated SQL from a bulk wrap is unsafe for untrusted data.
- What about the last line's separator?
- If you are building a delimited list, the final element needs no trailing separator. A suffix applied uniformly leaves a trailing comma, which is invalid in JSON and in most SQL dialects.
- Should the prefix apply to blank lines?
- Usually not — prefixing an empty line produces a line containing only the prefix, which shows up as stray punctuation in the output. Skipping blanks is the safer default and is what quoting tools do.
- How is this used to build a query?
- Wrapping each line in quotes and appending a comma turns a pasted column into an `IN (...)` list. The last line needs no trailing comma, which is the one detail that has to be handled separately.
Common errors and gotchas
- Adding a prefix to blank lines, which produces stray markers with nothing after them.
- Forgetting the last line needs different treatment, such as no trailing comma.
- Adding a prefix that the destination format then escapes or interprets.
- Overlooking trailing whitespace, which ends up between the text and the suffix.
- Applying it twice, which doubles the prefix without any obvious sign.
Related Text Tools tools
Case Converter
Convert between Sentence, Title, camelCase, snake_case, and more.
Word Counter
Count words, characters, and analyze keyword density.
Text to Binary
Convert text into its 8-bit binary representation.
Binary to Text
Decode 8-bit binary back into readable text.
Text Reverser
Reverse text by characters, words, or lines.
Remove Duplicate Lines
Delete repeated lines and keep your list unique.
Remove Empty Lines
Strip blank and whitespace-only lines from text.
Sort Lines Alphabetically
Sort lines A–Z or Z–A, case-sensitive or not.