About Lines → JSON Array
Lines → JSON Array converts your input into a JSON-encoded array of strings — `["item1","item2",…]`. Each line becomes one quoted, properly-escaped element, and the result is valid JSON ready to paste into a config file, a JavaScript or Python source file, an OpenAPI enum, or any other consumer that parses JSON.
This is the JSON-aware counterpart of Lines → Delimited String. Both produce a single-line representation of a list, but Lines → Delimited String is a literal join with no quoting (good for CSV cells and shell args), while this tool wraps each item in double quotes and escapes the characters JSON requires escaping — quotes, backslashes, and control characters. Use this whenever the consumer parses JSON; use the delimited tool when it does not. The output is on a single line by default; pretty-print it later by piping through JSON Formatter.
Examples
apple
banana
cherry["apple","banana","cherry"]Each line becomes a quoted string element. Special characters like `"` and `\` are escaped automatically.
Frequently asked questions
What if my items already contain quotes?
The tool escapes them automatically. A line containing `She said "yes"` becomes `"She said \"yes\""` in the array — valid JSON that round-trips through any parser.
How is it different from Lines → Delimited String with `,` as the delimiter?
The delimited tool produces `apple,banana,cherry` — no quoting, no escaping. This tool produces `["apple","banana","cherry"]` — a real JSON array. Use the delimited tool when the consumer just splits on a character; use this tool when the consumer parses JSON.
Are the items always strings?
Yes. This tool emits an array of strings; numbers, booleans, and nulls in the input are still quoted as strings. If you want typed values, build the array by hand or post-process in JSON Property Editor.
Can I pretty-print the output?
The output is single-line for compactness. Paste it into the JSON Formatter tool to indent and break it across multiple lines.
