The standard way to add quotes to every line in Notepad++ is two passes through Find and Replace with regex enabled: replace the line-start anchor ^ with ", then replace the line-end anchor $ with ", and the entire file is wrapped. This works for any plain list whose content has no embedded quote characters, but it falls short the moment the output has to land in JSON, SQL or CSV, because none of the embedded quotes are escaped. RFC 8259 says a double quote inside a JSON string literal must become \"; ISO SQL, the rule PostgreSQL and SQLite document, says a single quote inside a string literal must double to ''; RFC 4180 says a CSV field containing a double quote must encode it by doubling. 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 Regex Method in Notepad++ (and Exactly What It Does)
In Notepad++, press Ctrl+H to open Find and Replace. In the Search Mode box at the bottom, select "Regular expression". Leave "Wrap around" checked so the operation continues past the end of the file. The two anchors that matter are ^ and $, both zero-width: they match the position at the start and end of a line without consuming any characters.
For the first pass, type ^ in Find what and " in Replace with. Click Replace All. This prepends a double quote to every line in the file, including blank lines. For the second pass, type $ in Find what and " in Replace with, then click Replace All again. Every line now has a double quote at both ends. Notepad++ uses Boost regular expressions, which treat ^ and $ as line anchors by default, so a line ending with Windows CRLF still matches $ at the line boundary rather than at the carriage return.
If you only want to wrap non-blank lines, the regex becomes slightly longer. Search for ^.+?$ with Replace with "$0". The $0 token refers to the entire match, so the engine inserts the matched content between two literal quote characters. Blank lines have nothing to match and are skipped automatically. The same pattern with single quotes becomes '$0' for a SQL IN list, though escaping still has to happen by hand.
Where the Regex Method Breaks Down
The regex trick handles wrapping cleanly. What it does not handle is escaping, and escaping is what determines whether the output is paste-ready. Consider a list that contains names with apostrophes: O'Brien, D'Angelo, Mc'Coy. After the Notepad++ regex wrap, every line becomes "O'Brien". If that gets pasted into a PostgreSQL query as part of an IN clause, the database rejects it: SQL string literals use a doubled single quote as the escape, not a backslash. According to the PostgreSQL documentation on lexical structure, 'O'Brien' is a syntax error; 'O''Brien' is the correct literal.
The same input wrapped the same way produces different output for a JSON array. A line containing say "hi" wrapped with the regex becomes "say "hi"". RFC 8259 says embedded double quotes must be backslash-escaped, so the correct JSON string literal is "say \"hi\"". Paste the unescaped version into JSON.parse and the parser fails on the first inner quote.
A CSV file follows yet a third rule. Per RFC 4180, fields containing commas, double quotes, or line breaks must be enclosed in double quotes, and any embedded double quote is escaped by doubling it. So the field say "hi" becomes "say ""hi""". The regex approach gives you "say "hi"", which is malformed CSV: the field terminator is wrong and a parser will read it as three fields, not one.
A Faster Path for JSON, SQL and CSV
This is the small chore every developer recognizes: 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. Doing it by hand in Notepad++ means three separate Find and Replace passes per format, plus manual escaping of any embedded quote character, plus the surrounding brackets or parentheses. The Add Quotes to Each Line tool collapses that into a single click per format, with the escaping rule for that format already applied.
The presets encode the three standards cited above plus a fourth style for JavaScript template literals. Each preset is pinned against the standard it follows, so the JSON output is valid against RFC 8259, the SQL output is valid against the ISO SQL string literal rule, and the CSV output is valid against RFC 4180. The same input line produces different correct output under each preset.
How to Use the Tool
- Paste your list, one item per line, into the input field.
- Click the preset for the format you need: JSON array, SQL IN clause, CSV row, or plain quotes.
- Fine-tune quote style, delimiter, or escaping if needed, then copy the paste-ready result.
Individual controls are available for every step the presets perform. You can choose the quote character including no quotes at all, set the delimiter with or without a trailing delimiter on the last line, toggle escaping on or off, skip blank lines, and trim per-line whitespace. The result reports how many lines were processed, which is useful for confirming the input was read the way you expected.
The tool handles inputs up to one million characters in a single linear pass, so even very long lists return instantly. Everything runs in the browser, which matters because the lists developers feed into this kind of tool are often exactly the kind of ID or name data they would rather not upload to a random website. No data leaves the tab.
Escaping Rules by Format
The same input line produces different correct output depending on which format is the target. The differences are not stylistic; they are defined by the standards each format cites. The table below compares the four presets the tool offers.
| Format | Quote character | Embedded quote rule | Standard |
|---|---|---|---|
| JSON string | Double quote " | Backslash-escape: \" | RFC 8259 |
| SQL string literal | Single quote ' | Double the quote: '' | ISO SQL, PostgreSQL, SQLite |
| CSV field | Double quote " | Double the quote: "" | RFC 4180 |
| JS template literal | Backtick ` | Backslash-escape: \` | ECMAScript |
A JSON array wraps every entry in double quotes, escapes embedded double quotes with a backslash, and surrounds the whole list with square brackets. A SQL IN list wraps every entry in single quotes, doubles any embedded single quote, and surrounds the whole list with parentheses. A CSV row wraps every entry in double quotes, doubles any embedded double quote, joins them with commas on a single line, and ends without a trailing comma. The backtick preset covers JavaScript template literals and escapes backticks and the ${ interpolation opener so pasted content cannot inject an expression.
Notepad++ vs. the Browser Tool
Use the Notepad++ regex method when the list is short, the content is plain, and you only need a quick wrap with double quotes. The two-pass Find and Replace takes seconds and leaves the file open in your editor for further editing. It is also a useful learning exercise: the two-anchor approach generalizes to any wrapping pattern, including bracketing each line with custom delimiters.
Use the browser tool when the list needs to land in code or data that interprets the output as syntax. JSON, SQL, and CSV all have escaping rules, and the cost of getting them wrong is a syntax error at parse time, a runtime exception, or silent data corruption in a CSV import. A tool that applies the correct rule per format removes that risk and produces paste-ready output in one click.
For a regex-free Notepad++ workflow using Column Mode and the Edit menu instead of Find and Replace, see the companion guide on adding quotes to each line in Notepad++ without regex. When the wrapping has no rules and you only need literal text on either side of each line, the Add a Prefix and Suffix to Lines tool handles arbitrary text without any escaping logic.
One behaviour worth knowing applies to any quoting tool: running it on its own output wraps it again, because a quoting tool cannot tell whether existing quotes in the input are content or previous wrapping. If you need to re-wrap with different settings, start from the original list.