Convert a List to a JSON Array

Paste one item per line and get back a valid JSON array with correct escaping — quotes, backslashes and Unicode all handled for you.

Escaping is the part worth automating

Wrapping lines in quotes and adding commas is easy enough to do by hand — until one of your values contains a quotation mark, a backslash, a tab, or an emoji. At that point hand-built JSON stops parsing, and the error message points at a line number that is rarely where the real problem is.

This converter runs your list through the browser's own JSON serialiser, the exact same implementation that will later parse it. Quotes become \", backslashes double up, control characters become escape sequences, and Unicode passes through intact. If it comes out of this tool, it will parse.

Three shapes, one input

JSON array takes one value per line and produces ["red", "green", "blue"]. Blank lines are dropped and each value is trimmed, because a leading space in a JSON string is almost never intentional.

JSON object reads key: value or key,value pairs, one per line, and produces a single object. Handy for turning a two-column paste into a lookup table or a config block.

CSV to JSON treats the first line as a header row and produces an array of objects, one per data row. Quoted cells containing commas are handled correctly, as are doubled quotes inside a quoted cell, so a real spreadsheet export survives the trip.

Numbers, and why they are opt-in

By default every value comes out as a string, including things that look like numbers. That is deliberate: identifiers such as ZIP codes, phone numbers, product SKUs and version strings frequently look numeric but must stay text — "01234" is a valid postcode, 1234 is not the same thing, and 1.10 becomes 1.1 the moment it is treated as a number.

When your list really is numeric, tick Detect numbers and any value that parses cleanly as a number is emitted unquoted. Mixed lists are handled per-value, so a list of measurements with an occasional N/A keeps the numbers numeric and the text as text.

Typical uses

  • Seeding a dropdown, an enum or a test fixture from a list someone sent you in an email.
  • Building an IN (...) equivalent for an API that expects a JSON array of IDs.
  • Converting a column copied from a spreadsheet into a request body without opening an editor.
  • Turning a list of feature flags or allowed values into a config file entry.

Frequently asked questions

How are quotes and special characters handled?

Automatically. The conversion uses the browser's native JSON serialiser, so quotation marks, backslashes, tabs, newlines and Unicode characters are all escaped correctly and the result is guaranteed to parse.

Why are my numbers wrapped in quotes?

Because that is the safe default — it protects identifiers such as ZIP codes and SKUs that would lose leading zeros or trailing decimals if treated as numbers. Tick Detect numbers to emit numeric values unquoted.

Can it convert a CSV export?

Yes, with the CSV to JSON mode. The first line is read as the header row and each following row becomes an object. Quoted cells containing commas are parsed correctly.

Is there a size limit?

The interface accepts up to 200,000 characters per run, which is roughly 20,000 typical list items. Split larger inputs into batches.