Convert a JSON array to lines

Parse valid JSON only when its top-level value is an array and every item is a string.

Runs in your browser. Your text is not uploaded.

Worked example

Before

["alpha", "beta", "gamma"]

After

alpha
beta
gamma

The three validated string items are emitted in array order as plain lines.

Exactly what this changes

  • The input is parsed with JSON.parse and is never evaluated as code. Once validated, each string item is placed on its own output line in the same array order, including duplicates and zero-length strings.
  • Objects, numbers, booleans, null values, and nested arrays are rejected. When an array item has the wrong type, the error identifies its zero-based index so the source can be corrected without guessing.
  • Invalid syntax or an invalid item leaves the existing source and output untouched. PlainSift does not coerce values to strings, discard unsupported entries, partially return an array, or attempt to repair malformed JSON.

Options and edge cases

  • There are no coercion controls because the accepted format is deliberately narrow: one top-level array of strings. JSON formatting whitespace outside and between values is accepted by the parser.
  • Escaped quotes, backslashes, tabs, line breaks, and Unicode sequences are decoded according to JSON rules. The resulting string values are then joined with LF line endings for the plain-text output.

Edge case: A string item that itself contains a line break will naturally occupy more than one visual output line after decoding. Converting that result back to an array cannot recover the original item boundary without another format.