Adding quotes to each line means wrapping every entry of a pasted list with a matching pair of quotation marks — usually a double quote for JSON or CSV, a single quote for SQL, or a backtick for JavaScript template literals — and then joining the wrapped entries with a delimiter so the result is paste-ready code. The right way to do it depends entirely on the format you are pasting into, because each format has its own rule for handling quotes that already appear inside the value. A list of product names with apostrophes, for instance, breaks SQL if the apostrophes are not doubled, breaks JSON if double quotes inside the values are not backslash-escaped, and breaks CSV if double quotes are not doubled within the field. Add Quotes to Each Line handles those rules for you: paste a list, click the preset for the format you need, and the tool wraps each line and applies the matching escaping in a single pass. The output is the exact syntax for JSON arrays, SQL IN clauses, or single-line CSV rows, with no manual editing and no risk of forgetting an escape.

add quotes to each line
add quotes to each line

What Adding Quotes to Each Line Does

Wrapping a list in quotes is one of those chores that looks trivial until you have to do it more than twice. A teammate pastes fifty user IDs in chat, a tester hands you a column of product SKUs from a spreadsheet, or a script needs a fixed allowlist of feature flags — and suddenly you are typing quote, value, quote, comma over and over, trying to remember whether SQL uses backslash-escapes or doubled quotes. The Add Quotes to Each Line tool is built for exactly this moment. It takes one item per line, wraps every entry in the quote style that matches the destination format, joins them with the right delimiter, and emits the surrounding brackets, parentheses, or row that the syntax expects. The work that would otherwise take a careful hand and a steady eye happens in one click.

The output is not generic text with quotes around it. Each preset encodes a specific published standard: the JSON preset follows RFC 8259 for string literals, the SQL preset follows the doubled-single-quote rule documented for PostgreSQL, SQLite, and the ISO standard, and the CSV preset follows RFC 4180 for embedded double quotes. Those three rules are different from one another, and the difference is exactly what the presets capture.

When You Need to Quote a List

The situations where a plain list has to become quoted syntax come up across every part of a working day. Some of the most common:

  • Building a JSON array fixture for a unit test from a list of names or IDs pasted out of a spreadsheet.
  • Assembling a SQL WHERE ... IN (...) clause for an ad-hoc query, especially during incident response when the values are coming from log lines rather than a table.
  • Constructing a CSV row for a one-off import into a system that needs the entire row on a single line.
  • Producing an environment allowlist of feature flags or API keys that ships in a config file.
  • Generating an i18n string table for a small set of translations where the values are easier to author line-by-line.
  • Writing test data fixtures that have to match exactly what the code under test expects.

In each case the list arrives as one item per line, the destination wants each item wrapped and joined, and the difference between formats is what would otherwise take the most time. The tool exists to collapse that difference into a single click.

If the list you are quoting has duplicates, cleaning it first is worth the extra step — the quoting tool wraps what you give it, so duplicates stay duplicates. Pair the quoting step with a Remove Duplicate Lines pass for lists pulled from logs, and the result is both unique and correctly formatted.

How to Add Quotes to Each Line in Three Steps

The full workflow takes three steps and returns immediately, even on long lists.

  1. Paste your list into the input box, one item per line. Empty lines are fine and skipped by default. Trim each line if you have leading or trailing whitespace you do not want in the output.
  2. Click the preset for the format you are pasting into: JSON array, SQL IN clause, CSV row, or plain quotes if you only need wrapping without joining.
  3. Adjust the quote style, delimiter, or escaping only if the defaults do not match your target — for example, switching the delimiter to a semicolon, choosing single quotes instead of double, or turning off escaping for a downstream tool that handles it itself. Then copy the paste-ready result.

The output reports how many lines were processed so you can confirm every input line made it through. You can switch presets at any point on the same input, which makes it easy to compare what JSON, SQL, and CSV do with the same list.

How Each Format Escapes Embedded Quotes

A line containing a quote character is where hand-rolled quoting usually falls apart. The same input behaves differently under each format, and the format you are pasting into dictates which behavior is correct.

Format Wrapper character Embedded quote rule Published source
JSON array " (double quote) \" — backslash escape RFC 8259
SQL IN clause ' (single quote) '' — doubled quote PostgreSQL / SQLite / ISO
CSV row " (double quote) "" — doubled quote RFC 4180
Backtick template ` (backtick) \` and \${ — escape backtick and interpolation opener JavaScript template literal rules

Take the value it's, for instance:

  • JSON preset: ["it's"] — the apostrophe inside needs no special treatment in JSON, but if the value contained a literal double quote (say he said "hi"), the output would be ["he said \"hi\""].
  • SQL preset: ('it's') becomes ('it''s') — the apostrophe is doubled per the SQL string literal rule that PostgreSQL, SQLite, and the ISO standard all use. Per the PostgreSQL lexical structure documentation, SQL string constants escape single quotes by repeating them, not by adding a backslash.
  • CSV preset: ("it's","he said ""hi""") becomes a single line where each field is wrapped in double quotes and any embedded double quote is itself doubled.

The tool applies these rules without you needing to remember which is which. You choose the format, and the tool applies the right rule. The same input under the JSON preset produces a string with backslash-escaped double quotes, while the same input under the SQL preset produces a string with doubled single quotes. Each of those outputs is valid for its target format and would be invalid in the others — which is the entire reason presets exist rather than a single generic "add quotes" mode.

Choosing a Quote Style for Plain Text and Templates

Beyond the three named formats, the same tool exposes the underlying controls so you can wrap lines for any destination. The quote style selector covers single quotes, double quotes, backticks, and none. Each one suits a different context:

Quote style Typical use Notes
Double quotes (") JSON arrays, CSV rows, shell strings Default; works for most code and data formats
Single quotes (') SQL string literals, some shell scripts Doubles single quotes inside values per SQL conventions
Backticks (`) JavaScript template literals Escapes backticks and the interpolation opener ${ so pasted content cannot inject an expression
None Just trim and join lines without wrapping Useful for producing CSV-style or TSV-style output where wrapping is unwanted

Backticks deserve a separate mention because their escaping rule is different from the others. An embedded backtick becomes a backslash-backtick, and the interpolation opener is escaped too. That makes the backtick preset safe for content where the destination is a JavaScript template literal — pasting the string ${user.name} would otherwise be interpreted as a code expression.

You can also turn off the comma delimiter entirely, choose a different delimiter such as a pipe or semicolon, or add a trailing comma to the last line when your target format wants one. The trailing-comma toggle is off by default because a JSON array or SQL IN list with a trailing comma is a syntax error in most contexts, and the tool is built to produce paste-ready output rather than something you have to clean up afterwards.

Privacy, Limits, and Re-Running the Tool

Two practical details matter once you start using the tool on real data.

The first is privacy. Lists you quote often contain identifiers, names, or tokens that you would rather not send to a server. The tool runs entirely in your browser: the input is processed locally, nothing is uploaded, and nothing is attached to an account. The data stays on the page you have open.

The second is the input cap. The tool accepts up to one million characters and processes the input in a single linear pass, so even very long lists return quickly. If your list is longer than that, splitting it before quoting is the safest path — or pair the tool with the site's Text File Splitter for predictable chunks you can re-join afterwards.

One behavior is documented rather than hidden: if you run the tool on its own output, it wraps the output again. A quoting tool cannot know whether quotes in the input are part of the content or wrapping added by an earlier run, so re-running double-wraps by design. If you need different settings — say, switching from JSON to SQL — start from the original plain list, not from the previous output.