How to turn lines of text into a JSON array
A list copied out of a spreadsheet or jotted down in a text editor has to become a JSON array before it can go into code. Paste one item per line and this tool adds the quotes and commas for you, producing an array you can use as it is. It is handy for moving a list into a constant, building a request body while testing an API, or dropping a set of values into a config file.
Quotes and special characters are escaped the standard way. The output is produced by the browser's built-in JSON support, so double quotes, backslashes and tabs inside a line are handled to spec, and non-Latin text and emoji are preserved. The broken output you get from gluing quotes together by hand simply cannot happen here.
Turning on automatic number conversion makes number-like lines into unquoted numbers. Keep in mind that 007 becomes 7 and very long digit strings may be rewritten, so leave it off for zip codes, employee IDs and anything where a leading zero matters. When any item is rewritten, the count is shown above the output. You can also drop blank lines, trim surrounding spaces, and pick 2-space, 4-space or single-line formatting.
Frequently asked questions
Yes. The output goes through the browser's built-in JSON conversion, so double quotes, backslashes and tabs are escaped to spec. You can paste the result straight into code or a config file without it breaking.
It becomes the unquoted number 7. Leave number conversion off for zip codes, employee IDs or phone numbers where the leading zero matters. The summary tells you how many items were rewritten.