YAML to JSON Converter

JSON Tools

How to use the YAML to JSON Converter

Convert YAML to JSON in seconds:

1

Paste your YAML

Paste any YAML content into the editor — single document or multi-document (--- separated).

2

Enable multi-document if needed

Toggle 'Multi-document YAML' if your input contains multiple --- separated documents. Each document becomes one element in a JSON array.

3

Click Convert

Get clean, indented JSON output immediately. YAML anchors and aliases are fully resolved.

4

Copy or download

Copy the JSON to clipboard or download it as a .json file.


When to use this tool

Use YAML to JSON Converter when you need to:

  • Convert a Kubernetes YAML manifest to JSON for use with kubectl or JSON-based tooling
  • Process a YAML OpenAPI / Swagger spec into JSON for tools that only accept JSON Schema
  • Convert Docker Compose or Helm chart YAML to JSON for analysis or transformation scripts
  • Debug a YAML configuration by converting it to JSON for easier inspection in browser DevTools
  • Convert GitHub Actions or CI/CD pipeline YAML to JSON for programmatic processing

Frequently asked questions

Q:Are YAML anchors and aliases supported?
Yes. YAML anchors (&anchor_name) and aliases (*anchor_name) are fully resolved during conversion. The output JSON shows the complete dereferenced values at every alias location — there are no references or pointers in the JSON output.
Q:What happens with multi-document YAML separated by ---?
Enable the 'Multi-document YAML' toggle. Each document separated by --- is parsed independently and the output is a JSON array where each element corresponds to one YAML document, in order.
Q:Are YAML comments preserved in the JSON output?
No. JSON does not support comments, so all YAML comments (lines starting with #) are stripped during conversion. This is expected behavior and not a data loss issue since comments carry no machine-readable data.
Q:What YAML types are supported?
All core YAML 1.2 scalar types: strings, integers, floats, booleans (true/false/yes/no), null, and datetime values. Datetime values are converted to ISO 8601 strings in the JSON output since JSON has no native date type.
Q:Can I convert a Kubernetes manifest with multiple resources?
Yes. A Kubernetes manifest file with multiple resources separated by --- is a multi-document YAML file. Enable the 'Multi-document YAML' toggle and each resource (Deployment, Service, ConfigMap, etc.) becomes one element in the output JSON array.
Q:Why does my YAML convert to null or an empty object?
This usually means the YAML is using a feature or indentation that the parser couldn't interpret. Check for: incorrect indentation (YAML is whitespace-sensitive), tabs instead of spaces (YAML requires spaces), or a BOM character at the start of the file if copied from Windows. Paste into a plain text editor first to strip any hidden characters.