Skip to main content

Convert YAML to compact JSON

Build a compact JSON fixture from a readable YAML list without a separate minification step.

  1. Parse the YAML document

    YAML to JSON

  2. Remove JSON formatting whitespace

    JSON Minifier

Run both steps

What to check in the example

Three YAML list entries become a one-line JSON array. In this sample the units are numbers and the space inside Pens, blue remains.

Download the source example

Working with your own file

Comments and other YAML presentation details have no JSON representation. Check scalar types if a consumer requires a strict schema.