Add Prefix & Suffix to Lines

Add a prefix, suffix, or both to every line of text. Wrap lines with tags, quotes, delimiters, or any text. Free online tool.

🔒 Your text stays in your browser - nothing is sent to our servers
Prefix
Suffix
Presets:
Input
0Characters
0No spaces
0Words
0Sentences
0Lines
< 1 minRead time
Output
How to Use

Three steps to get started

1

Enter prefix and/or suffix

Type the text you want to add before each line (prefix) and/or after each line (suffix). Use the presets for common patterns.

2

Paste your list

Paste your text - one item per line. The output updates instantly as you type.

3

Copy or download

Click Copy to grab the result, or Download to save as a text file.

About This Tool

Wrap every line with custom text - instantly

A prefix is text inserted at the start of a line and a suffix is text appended to its end. Applying both to every line of a list is one of the most common small text-manipulation jobs there is - it is how a plain list of names becomes an HTML list, a SQL IN clause, a Markdown bullet list, or a block of commented-out code. Doing it by hand across 200 lines is slow and produces exactly the kind of one-missed-line error that is hard to spot.

Practical examples:

  • Wrap items in <li></li> tags to build an HTML list from a plain list
  • Add ' around each line to create SQL IN ('a', 'b', 'c') clauses
  • Prefix lines with - or for Markdown or presentation bullet points
  • Wrap values in double quotes for CSV or JSON array formatting
  • Add // to comment out multiple lines of code at once
  • Surround lines with pipe characters for Markdown table rows

The tool includes six presets for the most frequently needed patterns, and both fields accept arbitrary text - special characters, HTML entities, multi-character strings, or plain whitespace. Leave one field empty to apply only the other, which is how you add indentation to a block of code (a prefix of four spaces, no suffix) or append a trailing comma to every line for a JSON or Python list.

Gotchas worth knowing before you paste the output

The last line still gets a suffix. For an SQL IN clause or a JSON array built with " and ", that leaves a trailing comma on the final entry, which most SQL engines and strict JSON parsers reject. Delete that one character by hand, or note that JSON5, modern JavaScript, and Python all tolerate trailing commas.

Blank lines are lines. An empty line in your input receives the prefix and suffix like any other, producing stray <li></li>elements or empty quoted values. Strip blank lines first if that matters.

Nothing is escaped for you. Wrapping values in single quotes for SQL does not neutralize an apostrophe inside the data - a line readingO'Brien becomes 'O'Brien' and breaks the statement. The same applies to & and < in HTML and to double quotes inside CSV fields. Escaping is your responsibility; the tool concatenates text and nothing more.

All processing happens in your browser. Nothing is sent to a server, there is no cap on document length, and the output regenerates on every keystroke so you can see the effect of a change immediately.

FAQ

Frequently Asked Questions

Related Tools