Skip to content

Lines to a JSON array

Turn a pasted list into a valid JSON array of strings.

  1. 1.Text to array converter

Paste one item per line and get a JSON array back — double-quoted, fully escaped and valid against the JSON specification, so it can go straight into a request body, a fixture file or a config value. Quote style and escaping options do not apply here: JSON has exactly one correct form and this always emits it.

A trailing comma is also skipped, because it is invalid JSON no matter what your code style says elsewhere. Characters that need escaping — quotes, backslashes, tabs — are handled for you.

Questions

Why can I not switch to single quotes?
JSON strings must use double quotes. A single-quoted array would not parse, so that option is deliberately ignored for this format.
How are special characters handled?
They are escaped according to the JSON spec, so quotes, backslashes and control characters inside an item are safe.
Can I get an array of numbers instead of strings?
Yes — numeric items are written unquoted, so a list of numbers becomes a JSON array of numbers.

Build your own chain in the pipeline builder.