Add Prefix / Suffix to Lines

Add text to the start or end of every line.

Free add prefix and suffix to lines tool — add text to the start and end of every line at once, skip empty lines and optionally trim each line first. Runs entirely in your browser, nothing is uploaded. It runs free in your browser on Gera Tools, with nothing uploaded.

Last updated Source: Gera Tools

Can I add only a prefix or only a suffix?

Yes — leave either field empty. Fill in just the prefix to prepend text, just the suffix to append text, or both to wrap each line.

The Add Prefix / Suffix to Lines tool adds text to the start and the end of every line in a list at once. It saves the repetitive work of manually editing each row when you need to quote values, wrap items in tags, comment out code, or build delimited lists. Paste your lines, type the prefix and suffix, and the result updates instantly.

How it works

The tool splits your input into individual lines and rebuilds each one as prefix + line + suffix. Both fields are independent: leave the prefix empty to only append a suffix, leave the suffix empty to only prepend, or fill both to wrap each line. Two options refine the result:

  • Skip empty lines — by default, blank or whitespace-only lines are left untouched so you do not get stray prefixes on empty rows. Turn it off to apply the prefix and suffix everywhere.
  • Trim each line first — strips leading and trailing whitespace from each line before wrapping it, so indentation does not become part of the wrapped content.

Common use cases with examples

SQL IN clause

Convert a list of names into a quoted, comma-separated SQL list:

Prefix: ' / Suffix: ',

Alice
Bob
Carol

becomes:

'Alice',
'Bob',
'Carol',

HTML list items

Wrap items in li tags:

Prefix: <li> / Suffix: </li>

Apples
Bananas
Cherries

becomes:

<li>Apples</li>
<li>Bananas</li>
<li>Cherries</li>

Comment out lines

Add a comment marker to every line:

Prefix: # / Suffix: (empty)

CSV quoting

Wrap values that might contain spaces:

Prefix: " / Suffix: "

Markdown bullet list

Prefix: - / Suffix: (empty)

When to trim first

Use the trim option when pasting from a spreadsheet or indented code editor, where lines may carry leading spaces. Without trimming, the prefix lands before the whitespace — ' Alice' rather than 'Alice' — which usually breaks the target format.

Everything runs in your browser — nothing is uploaded.