A list becomes a JSON array, one item per string
This is the narrowest JSON output you can produce from a list: an array of strings. Every non-empty input line becomes one element, wrapped in double quotes, with any characters inside the line that would break JSON (`"`, `\`, `\t`, control characters) escaped to their JSON-safe form. Nothing else is inferred - numbers stay as quoted strings, booleans stay as quoted strings. If you need typed output, run a transformation first, then feed the result in here.
Two toggles control the output shape. `Pretty print` wraps the array across lines with two-space indentation so a human can scan it; turning it off gives you a single-line compact form that diffs and greps well. `Skip empty` (on by default) filters out zero-length lines, so trailing blanks in your paste do not produce empty strings in the array. Turn it off if you genuinely want `""` entries - the tool will preserve them in position.
One input line = one array element. A literal newline in the textarea starts a new item; this tool does not support multi-line JSON string values. If your source data genuinely has newlines inside a string, pre-escape them (`\n`) before pasting, or build the JSON directly. All escaping on the remaining characters comes from the browser's built-in `JSON.stringify`, so the output parses cleanly in any JSON parser - Python, jq, `JSON.parse`, a Postgres `jsonb` column, anywhere.
How to use convert a list to a json array
- 1Paste your list into the input panel, one value per line
- 2The output is a JSON array of strings - each line becomes one element
- 3Toggle Pretty print off if you want a compact single-line array for diffs or grep
- 4Toggle Skip empty off if you want empty input lines preserved as `""` elements
- 5Copy the array or download it as a .json file from the output panel
Keyboard shortcuts
Drive ListShift without touching the mouse.
What this tool actually produces
Fixed behaviors, with two toggles for formatting.
A JSON array of strings - always
The output is always `[…]` with string elements. Numbers, booleans, and nulls are not inferred - `42` in the input becomes `"42"` in the output. That keeps the conversion lossless and predictable; if you need typed data, you probably want to write the JSON directly rather than round-trip through a list.
Automatic JSON-safe escaping on in-line characters
Quotes, backslashes, tabs, and control characters inside each line are escaped using `JSON.stringify` rules (`"` becomes `\"`, tab becomes `\t`, and so on). Note the constraint: the tool is line-based, so each textarea line is exactly one array string. A literal newline in your paste starts a new element; it cannot live inside a single JSON string value.
Pretty-print vs compact
Pretty print (on by default) uses two-space indentation with one element per line - ideal for reading or pasting into docs. Off gives you `["a","b","c"]` on a single line - ideal for compact storage, URL params, or anywhere a JSON array needs to fit on one line.
Skip-empty toggle, on by default
Empty lines are dropped before the array is built, so a trailing blank line in your paste does not produce `""`. Turn the toggle off and every line - including blank ones - becomes an element, so you get real `""` entries in the array at those positions.
Runs in your browser
The JSON is built client-side via `JSON.stringify`. Your list never leaves the tab - matters when you are pasting customer emails, internal IDs, or anything else you would not send to a random server.
Worked example
Embedded quotes are escaped automatically; the trailing blank line is dropped.
apple banana "fresh" cherry
[ "apple", "banana \"fresh\"", "cherry" ]
Settings reference
Two toggles. Everything else - escaping, string-only output, array wrapper - is fixed.
| Setting | What it does | Effect on the sample |
|---|---|---|
| Pretty print: on | Wraps the array across lines with two-space indentation | Produces the 5-line block shown in the example above |
| Pretty print: off | Emits a compact single-line array | `["apple","banana \"fresh\"","cherry"]` |
| Skip empty: on | Drops empty input lines before building the array | Trailing blank line is ignored - output has 3 elements |
| Skip empty: off | Preserves every line, including empty ones | Adds a `""` as the fourth element for the trailing blank |
| Escaping (automatic) | Quotes, backslashes, tabs, and control chars inside each line are JSON-escaped | `banana "fresh"` becomes `"banana \"fresh\""` |
| Newlines in items (not supported) | Tool is line-based - a textarea newline always starts a new array element | Cannot produce `"line 1\nline 2"` as a single string from pasted input |