YAML to JSON Converter (and JSON to YAML)

Convert YAML to JSON or JSON to YAML in one endpoint, with multi-document support and syntax errors reported with line and column.

Free tool: 20 requests per minute.

Result

Press “Run” to see the result.

Send yaml to get JSON, or json to get YAML; the direction is picked automatically and can be forced with to=json or to=yaml. YAML can also be posted as a raw text body (for example text/yaml) with to=json.

YAML to JSON returns valid, the parsed value in json and the number of documents; files with several documents separated by --- return an array. Invalid YAML returns valid: false with an error message, line and column instead of an HTTP error.

JSON to YAML accepts a JSON value or JSON string in json and returns the YAML text in yaml; indent sets the indentation (1 to 8, default 2). The request body is limited to 5 MB.

Use this in your code

curl -X POST "https://apibox.io.vn/v1/yaml" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"yaml":"name: APIBox\nversion: 1\nfeatures:\n  - html\n  - json\nenabled: true"}'

API documentation → Get a free API key

FAQ

How do I choose the conversion direction?

Send yaml to get JSON, or json to get YAML. To be explicit, add to=json or to=yaml.

Are multi-document YAML files supported?

Yes. Documents separated by --- are returned as an array in json, and documents gives their count.

How are YAML syntax errors reported?

The response is valid: false with error.message, error.line and error.column.