Skip to content

Prefix & Suffix Text

Wrap every line with text before and after, in one pass.

Use {n} in the prefix or suffix to insert the line number.

Quick Tool Overview

Prefix & Suffix Text wraps every line at both ends in one pass, with the extras a data format actually needs: escaped quoting, a separator that is correctly omitted after the last line, brackets around the whole block, and a {n} placeholder for the line number.

What it does
Adds text before and after every line at once
You give it
A list, one item per line
You get back
The wrapped list, ready for JSON, SQL or HTML
Best for
Turning a spreadsheet column into code or data
Text Tools Free, unlimited use No sign-up Runs in your browser

About the Prefix & Suffix Text

Wrapping every line of a list is how a column from a spreadsheet becomes something a machine can read. Names become quoted SQL values. URLs become HTML links. Tags become an array. IDs become a set of API calls. All of it is the same operation: something before each line, something after it.

This does both ends in one pass, with the details that turn a nearly-right result into a usable one. Quotes can be added and escaped properly. A separator can go between lines but not after the last one, which is what valid JSON and SQL require. The whole block can be wrapped in brackets. And a {n} placeholder in either the prefix or the suffix is replaced with the line number, so numbered output needs no second pass.

Key features of the Prefix & Suffix Text

Separator omitted after the last line

Which is exactly what makes the difference between valid JSON and a syntax error.

Quoting with proper escaping

Quotes already inside an item are doubled, the convention both SQL and CSV expect.

Block wrapping

Opening and closing text around the whole result finishes an array or an IN clause in the same pass.

The {n} placeholder

Put the line number anywhere in the prefix or suffix for numbered or annotated output.

Blank lines skipped

No item consisting only of your wrapper text, unless you explicitly ask for every line.

How to use the Prefix & Suffix Text

  1. 1

    Paste your list

    One item per line, straight from a spreadsheet if you like.

  2. 2

    Set the prefix and suffix

    The text to put before and after each line. Use {n} for the line number.

  3. 3

    Add a separator

    A comma between lines but not after the last one, which is what JSON and SQL need.

  4. 4

    Wrap the whole block

    Add opening and closing text around the entire result to finish an array or a clause.

Frequently asked questions

Set the prefix and suffix to a double quote, the separator to a comma, and wrap the block in square brackets. The separator is correctly omitted after the last line, so the JSON is valid.

Reviews of the Prefix & Suffix Text

What people who use the Prefix & Suffix Text think of it. Reviews come from visitors and are posted as written.

No ratings yet

Yours would be the first.

  • 5 0 reviews rated 5 stars
  • 4 0 reviews rated 4 stars
  • 3 0 reviews rated 3 stars
  • 2 0 reviews rated 2 stars
  • 1 0 reviews rated 1 star

Write a review

Used this tool? Your rating helps the next person decide.

Your rating

Plain text only — links, email addresses and HTML are not accepted. Your name and review are shown publicly; nothing else is collected. See the privacy policy.

0 reviews

Newest first

No reviews yet

Be the first to rate the Prefix & Suffix Text. It takes half a minute and no account.

Write the first review

More text tools