Prefix & Suffix Tool

Add a chosen prefix and suffix to every text line while preserving each line content.

Processed in your browser. Inputs are not uploaded by this tool.

Loading the interface. JavaScript is required; controls stay disabled until ready.

Text options
Editable

Paste or type the text you want to work with.

Read-only

Run the tool to generate your result here.

Input and output are limited to 1,000,000 UTF-16 units. Line operations support up to 20,000 lines; Compare is limited to 250,000 line pairs. Results remain plain text in your browser.

Add a prefix or suffix to every line

A prefix goes before each line, while a suffix goes after it. This tool repeats the same literal text around each entry in a pasted list. It saves editing every row separately when you need brackets, labels or a common beginning or ending. It is a line-editing tool, not a generator of grammatical prefixes or invented names.

How to prepend or append text

  1. Paste your list with one entry per line. Check for unwanted blank rows.
  2. Enter the text to add in Prefix, Suffix or both. Leave one field empty to change only the other side.
  3. Select Process text and inspect the result, including spaces and punctuation.
  4. Copy the output into your destination. Keep the original separately if you will need it again.

A simple prefix and suffix example

Put cat and dog on separate lines. A prefix of [ and suffix of ] produce [cat] and [dog]. To make a plain Markdown bullet list, use a hyphen followed by a space as the prefix and leave the suffix empty. The tool does not add that separating space automatically.

What happens to blank lines?

Every existing line receives the additions, including empty rows and a trailing empty line. An empty row with the bracket example becomes []. Completely empty input produces empty output. A long row that wraps on screen is still one line unless it contains a real newline. The line counter can help check this before you process a list.

Literal text, not code generation

The operation is prefix + original line + suffix. Existing characters are preserved; the tool does not trim entries, generate sequential numbers or expand placeholders. Typing {n} repeats those literal characters. Mixed line separators are reconstructed using the first separator found, and browser pasting can normalize them.

Adding quotation marks does not escape quotes already inside an entry. A wrapped list is therefore not automatically valid SQL, CSV, JSON or HTML. Use the destination's serializer or parameter binding for structured data. This tool also does not validate URLs or check whether a prefixed address exists. Review the result in context before using it.

Processing rules and steps

Prefixes and suffixes are literal. Blank lines, including a trailing empty line, receive both additions. Mixed line endings are reconstructed with the first ending found. Empty input produces empty output.

  1. Paste or type text into the labelled input.
  2. Enter the literal prefix and suffix to add to each line, then select Process text.
  3. Review the output, then copy it. Reset clears the current inputs and result.

Questions and answers

Does this escape HTML or code?

No. Output is plain text. Review and escape it appropriately before inserting it into another system.

How do I wrap each line in quotes for a SQL or code list?

Enter a single quote as the prefix and a quote followed by a comma as the suffix. A list of names becomes 'Anna', 'Ben', 'Chris', ready to paste inside an IN clause. Remove the comma from the last line by hand. For JSON arrays, use double quotes instead.

Can I add HTML tags to every line?

Yes. Use <li> as the prefix and </li> as the suffix to turn a plain list into HTML list items, then wrap the whole result in <ul> and </ul>. The same approach works for Markdown, for example adding - followed by a space to make bullet points.

Are blank lines affected?

Yes, every line receives the prefix and suffix, including empty ones. If your list has blank lines you do not want, remove them first with a text cleaner. This keeps the output predictable when the line count matters, such as when matching rows to a spreadsheet.

Choose your next task

  • Line counter: Check blank and non-empty lines before wrapping a list.
  • Remove duplicate lines: Deduplicate entries before adding a shared prefix or suffix.
  • Text sorter: Sort the original entries before applying their wrappers.
  • Text repeater: Bound literal repetition without promising numbering or message delivery.