Add Quotes to Each Line
Turn a pasted list into a paste-ready JSON array, SQL IN clause or CSV row in one click, with the escaping each format actually requires.
Privacy: your files never leave your device. All processing happens locally in your browser.
How to use
- 1.Paste your list, one item per line.
- 2.Click the preset for the format you need: JSON array, SQL IN clause, CSV row, or plain quotes.
- 3.Fine-tune quote style, delimiter or escaping if needed, then copy the paste-ready result.
About Add Quotes to Each Line
Add Quotes to Each Line turns a plain list, one item per line, into code you can paste straight into an editor, a query console or a spreadsheet import. It is the small chore every developer knows: a colleague sends fifty IDs in a chat message, and you need them as a JSON array, a SQL IN clause or a quoted CSV row. One click on the matching preset wraps every line in the right quote, joins them with commas, adds the surrounding brackets or parentheses, and, crucially, escapes the content the way that format actually requires.
Escaping is what separates this page from a generic prefix and suffix tool, and it is where hand-rolled attempts break. The JSON preset follows RFC 8259: an embedded double quote becomes a backslash escape and a backslash doubles, so a line containing say "hi" becomes a valid string literal instead of a syntax error. The SQL preset follows the standard string-literal rule used by PostgreSQL, SQLite and the ISO standard: an embedded single quote doubles, it does not take a backslash, so it's becomes 'it''s'. The CSV preset follows RFC 4180: fields are wrapped in double quotes and an embedded double quote doubles, with the whole row emitted on a single line. These three rules are different from one another, the difference is exactly what the presets encode, and each one is pinned against the standard it cites. The backtick style covers JavaScript template literals, escaping backticks and the interpolation opener so pasted content cannot inject an expression.
Everything the presets do is also available as individual controls: quote style including none, delimiter with or without a trailing one on the last line, off by default so a JSON array does not end with a stray comma, escaping on or off, blank-line skipping and per-line trimming. The result reports how many lines were processed. One behaviour is documented rather than hidden: running the tool on its own output wraps it again, because a quoting tool cannot know whether existing quotes are content or wrapping; if you need to re-wrap, start from the original list.
Input is capped at one million characters and processes in a single linear pass, so even very long lists return instantly. Everything runs in your browser: your data, which is often exactly the kind of ID list or name list you would rather not paste into a random website, is never uploaded, stored or attached to an account.
Use it for JSON fixtures, SQL WHERE ... IN lists, CSV construction, environment allowlists, test data, i18n string tables, feature-flag lists, or any moment where a list needs to become syntax. It pairs naturally with the site's duplicate-line remover and list comparison tools: clean the list first, then quote it here. The site's separate prefix and suffix tool remains the right choice when you need arbitrary text around each line; this page is the right choice when the wrapping has rules, because the rules are the product.
Methodology & sources
Split lines, optionally trim and drop blanks, escape each line per the selected format's published rule, RFC 8259 for JSON, doubled single quotes for SQL, RFC 4180 for CSV, then wrap and join with the chosen delimiter, leaving the last line clean unless a trailing delimiter is requested.
Frequently asked questions
- How is embedded-quote escaping handled?
- Per format, the way each standard requires: JSON backslash-escapes a double quote (RFC 8259), SQL doubles a single quote per the ISO rule PostgreSQL and SQLite document, and CSV doubles a double quote (RFC 4180). The same input produces different, correct escaping under each preset.
- Why does the last line have no comma?
- So the output is paste-ready: a JSON array or SQL IN list with a trailing comma is a syntax error in most contexts. A toggle adds the trailing delimiter when your target format wants it.
- What happens if I run it on its own output?
- It wraps again. The tool cannot know whether quotes in the input are content or previous wrapping, so re-running double-wraps by design; start from the original list if you need different settings.
Related tools
- Add Prefix and Suffix to LinesAdd literal prefix and suffix text to every pasted line, with an option to leave blank lines untouched.
- Compare Two ListsCompare two line-based lists in one pass and get stable union, common, A-only, B-only, and symmetric-difference outputs with optional case sensitivity.
- Remove Duplicate LinesKeep the first occurrence of each line with optional case and edge-whitespace comparison, while preserving the retained text exactly.
- Add Line Numbers to TextNumber every line of pasted text from a chosen starting value with a custom separator and optional zero padding.
- AI Text CleanerStrip the em dashes, curly quotes, hidden Unicode characters and padded spacing that AI assistants leave behind, with every rule switchable and every change counted.
- APA Citation GeneratorBuild correctly formatted APA 7th edition references for websites, books, journals, and newspapers in seconds.
Text Tools guides
View all- How to Find and Replace Text in AutoCAD
- How to Get All Links from a Word Document
- How to Remove Emoji from a Facebook Post
- Emoji Copy and Paste: Find and Copy Any Emoji Instantly
- How to Create a Batch File from a Text File Locally
- How to Change Case in Google Docs and Beyond
- How to Get Bold Text in WhatsApp Messages
- Add a Prefix to All Lines in Notepad++ and Online
- How to Add Line Numbers to Text in Word and Plain Text
- How to Add Line Numbers in Word and Plain Text
- Remove Duplicate Lines from Text in One Click
- How to Generate Random Words in HTML Pages
- Extract Phone Numbers from Any Text in Minutes
- Convert Numbers to Words in Excel Without Formulas or VBA
- How to Generate Lorem Ipsum in Canva for Faster Mockups
- How to Random List in Python Without Writing Code
- How to Count Lines in a Play Using a Browser Tool
- Remove Line Breaks from Text in Excel in One Simple Step
- Convert Brake Line Symbols to Literal Text for Code or Data
- Cute Kaomoji Copy and Paste for Roblox Chats and Bios