Skip to content

Data Conversion Suite · free · no sign-up

YAML to JSON

Convert YAML configuration into JSON.

How it works Report a problem

YAML to JSON Converter

Parse YAML documents and convert to structured JSON with hierarchy preservation

πŸ”— Nested SupportπŸ“‹ Arrays & Objects
YAML Input

About the YAML to JSON

Convert YAML configuration into JSON.

How to use the YAML to JSON

  1. Paste your YAML or click Sample.
  2. Choose the Indentation (2 or 4 spaces, or minified) and optionally Sort Keys.
  3. Press Convert to JSON and copy the result.

When to use the YAML to JSON

  • Sending YAML configuration data to an API or a program that expects JSON.
  • Checking exactly how a YAML file is parsed, since JSON shows the structure clearly.
  • Converting Kubernetes, OpenAPI or CI configuration for use in scripts.
  • Debugging indentation errors by seeing the resulting data structure.

Common mistakes to avoid

  • Mixing tabs and spaces. YAML only allows spaces for indentation.
  • Forgetting a space after the colon, so that key:value is read as one string.
  • Being surprised when values such as yes, no or 010 are converted into booleans or numbers. Quote them if you need text.

Tips

  • YAML is sensitive to indentation. Use spaces, not tabs.
  • YAML comments are not kept in JSON.
  • Use the minified output to save space when sending JSON over a network.
  • Sort keys for a stable output that is easy to compare.

Frequently asked questions

Why did I get an error?
The YAML is likely mis-indented or has a missing colon or quote.
Does YAML support comments?
Yes, with #. They are dropped in the JSON output because JSON does not allow comments.
What does an error mean here?
The YAML has a structure problem, usually a wrong indent, a missing colon or an unclosed quote. The message points to the line.
Can it convert several YAML documents in one file?
A file with several documents separated by --- is usually converted one document at a time.