YAML to JSON Converter

Convert YAML data to JSON online with a configurable indent width. Paste YAML and the formatted JSON appears instantly, useful for configuration file conversion.

FreeOnline Tool
Loading…

How to Use

  1. Paste or edit your YAML in the input box
  2. Optionally set the number of spaces used to indent the JSON output (2 by default)
  3. The converted JSON appears below in real time
  4. If the YAML is malformed, a specific parse error is displayed

Features

  • Converts YAML mappings, sequences and nested structures into equivalent JSON
  • Indent width of the JSON output is configurable to match your project's code style
  • Converts as you type, with no manual trigger
  • Reports a clear parse error when the YAML is invalid

Use Cases

Processing Kubernetes and CI config as JSON
Convert a YAML manifest or CI configuration to JSON so you can process it further with JSON tooling such as jq.
Migrating configuration formats
Convert content in bulk when a project moves from YAML configuration to JSON.
Preparing YAML for programmatic use
Convert to JSON first when working in an environment where parsing YAML directly is inconvenient.
Learning how YAML maps to JSON
Compare the same data written in both formats to understand the correspondence between them.

FAQ

Which parts of YAML syntax are supported?
The common constructs are covered: mappings, sequences, scalars such as strings, numbers, booleans and null, and nested combinations of these. More unusual extensions such as anchors, aliases and multi-document separators may not be fully supported.
What does the indent width setting do?
It controls how many spaces are used to pretty-print the JSON output, typically 2 or 4, so the result matches your project's style. It has no effect on the data itself.
Why am I seeing a YAML parse error?
Usually the indentation is inconsistent, a colon is missing the space after it, or the structure is otherwise malformed. Check the YAML and try again, and read the error message for the specific problem.
Is my data uploaded to a server?
No. Conversion runs entirely in your browser and nothing is transmitted.