How to Add Text to the Beginning or End of Every Line

Wrapping every item in a list with quotes, adding a URL prefix to a list of file paths, or putting an @ in front of a list of usernames is the same underlying job every time: add a fixed piece of text to the start or end of every line. Doing it by hand for more than a handful of lines is tedious and error-prone; doing it with a spreadsheet formula means writing a concatenation formula and dragging it down a column. A prepend/append option in a text tool does the same job in one pass, on a plain pasted list, with no formula and no column of results to copy back out.

Quick answer

Paste your list into Text Fixer and use the Prepend field to add text to the start of every line, or Append to add it to the end - both can be used at once. It runs as part of the same pass as trimming, deduplication, and sorting, so you can combine adding a prefix with other cleanup in one step.

Add a prefix or suffix to every line now. Free, no account needed.

Open Text Fixer →

Common jobs this solves

  • Wrapping values in quotes - set both Prepend and Append to ' or " to turn a plain list into individually quoted values.
  • Adding a URL prefix - a list of file names becomes a list of full URLs by prepending https://example.com/files/ to every line.
  • Trailing commas for a code snippet - append , to every line to turn a plain list into comma-terminated entries ready to paste into an array or list literal.
  • Prefixing usernames - prepend @ to a plain list of handles exported from a spreadsheet or CRM.
  • Building a partial SQL fragment - prepend INSERT INTO table VALUES (' and append '); to turn a list of values into individual insert statements.

Combining with other cleanup steps

Prepend and append are two options among several in Text Fixer, and they all apply in a single pass over your pasted list - trimming leading and trailing spaces, removing duplicate lines, removing leading zeros, sorting alphabetically or numerically, and changing case are all available at the same time. In practice this means you can paste a messy exported list, trim it, deduplicate it, sort it, and wrap every remaining line in quotes in one operation instead of running four separate tools in sequence and copy-pasting between each one.

Output format options

Beyond prepend and append as raw text, the tool's output format setting can wrap the whole result as a numbered list, an HTML unordered or ordered list, or a plain joined string - useful when the "text you want added" is really structural formatting rather than a literal fixed string. For fully-formed structured output like a SQL IN clause, a JSON array, or Markdown bullets, the dedicated List to Format Converter builds the complete structure - correct commas, brackets, and quoting - in one step rather than assembling it manually with prepend and append.

When to use which tool

For a simple, literal string added to every line - a quote character, an @ symbol, a fixed URL prefix - prepend and append in Text Fixer is the fastest path and lets you combine it with other cleanup in the same pass. For a specific structured output format where commas need to go between items but not after the last one, or brackets need to wrap the whole list rather than each line, the List to Format Converter is built for exactly that and avoids getting the edge cases wrong by hand.

Need a full SQL IN clause, not just quoted values?

See how to build the complete clause with correct quoting in one step.

Read the guide →

Frequently Asked Questions

How do I add text to the start of every line in a list?
Paste your list into Text Fixer and enter the text you want in the Prepend field - it's added to the start of every line in one pass, no formula or per-line editing needed.
How do I add text to the end of every line instead?
Use the Append field instead of Prepend. You can use both at once if you need text added to both ends of every line - for example wrapping each line in a quote character on both sides.
Can I add a prefix and suffix in the same pass as other cleanup?
Yes - prepend and append are two of several options in the same tool, alongside trim, remove duplicates, remove extra spaces, sorting, and case conversion. They all apply together in one pass, so you don't need to run several separate tools in sequence.
How do I wrap every item in a list in quotes?
Set the prepend and append fields to the quote character you want (single or double). If you're specifically building a SQL IN clause or JSON array rather than a generic quoted list, the List to Format Converter handles quoting and separators for that format automatically.
Can I add a comma after every line except the last?
Appending a comma to every line including the last one is straightforward with the Append field. If you specifically need a trailing comma omitted from the final line (as valid syntax for some formats requires), the List to Format Converter's dedicated output formats handle that automatically.
How do I add @ in front of a list of usernames?
Set the Prepend field to @ and every line gets it added to the front - handles a full exported list of usernames without editing each one individually.
Does this work if my list has blank lines?
Yes, though note that a blank line will also get the prefix and suffix applied to it, turning it into just the prefix and suffix with nothing between them. If that's not what you want, remove blank lines first as a separate Text Fixer option.
Can I build a full SQL statement, not just wrap values in quotes?
For simple per-line wrapping (quotes, an @ symbol, a URL prefix) Text Fixer's prepend/append is the fastest path. For a complete SQL IN clause with commas and parentheses already assembled, the List to Format Converter builds the whole structure in one step.

Share this tool

Featured on ToolDirs
© 2026 ListDiff

Free online list and text processing tools.