TOOLTIKI Lovable tool, really free
Developer Lists

Text to JSON array

What to do

Transformed in your browser · nothing is uploaded

Local · escaped with JSON.stringify, not by hand
Advertisement
320 × 100

Turns a list of lines into a JSON array of strings with every value properly escaped — quotes, backslashes and control characters included.

How to use the text to json array

1 Paste your text into the first box.
2 Choose what you want done to it.
3 Copy the result, or save it as a text file.

Escaping is the whole reason to use a tool rather than wrapping each line in quotes by hand. A value containing a double quote or a backslash produces invalid JSON when quoted naively, and the failure appears wherever the JSON is eventually parsed rather than where it was built. Building it with `JSON.stringify` handles every case correctly, including the control characters that are invisible in the source. Blank lines are dropped and each value is trimmed, which is almost always wanted for a pasted list and is worth knowing if it is not.

Questions

A value containing a quote or a backslash produces invalid JSON. Proper escaping handles every case.

MDN — working with strings
Advertisement
300 × 250
Was this tool any good?
INTERNAL SIGNAL ONLY · WE USE IT TO FIND TOOLS WORTH REBUILDING