XML & YAML Tools

YAML → JSON

Convert YAML objects, arrays, and scalar values to JSON and report syntax errors.

Press Ctrl / ⌘ + Enter to run
Read-only result

Convert YAML objects, arrays, and scalar values to JSON and report syntax errors.

What this tool does

YAML's rules for indentation, block text, quotes, anchors, and scalars are more complex than they appear, so this tool uses a mature js-yaml parser to identify common structures and generate standard JSON.

  • Supports common YAML 1.2 structures and block text.
  • Parse settings depth, alias and merge key limits to reduce the risk of lags caused by malicious and complex input.
  • After conversion the result is generated using standard JSON.stringify.

How to use it

  1. Paste the YAML document.
  2. Click "Convert to JSON".
  3. If the syntax is invalid, correct the indentation or scalar according to the row and column prompts.
  4. Copy the results or download result.json.

Common uses

  • Convert CI/CD or container configuration to JSON.
  • Check the final resolved type of the YAML scalar.
  • Migrate configuration when your app only accepts JSON.

YAML → JSON Features

Convert objects, arrays, and scalars using a mature YAML parser and report syntax errors. It is suitable for daily development, debugging, data sorting and code optimization scenarios. The processing results can be directly viewed, copied or downloaded.

FAQ

Why not parse the YAML yourself?

YAML contains multi-line scalars, anchors, escaping and complex indentation rules, and mature parsers can cover more edge cases.

Will yes be converted to a boolean?

The tool adopts the YAML 1.2 core rules of the current js-yaml; it is recommended to explicitly write true/false to avoid ambiguities between different YAML versions.

Can a file contain multiple YAML documents?

This page is converted as a single document; if you enter multiple --- separated documents, corresponding restrictions or parsing errors will be displayed.

Back to Developer Tools