YAML ⇄ JSON

Convert between YAML and JSON in both directions with automatic input format detection.

Input

Drag and drop a file here, or

click to select

Output

About this tool

YAML dominates modern configuration (Docker Compose, Kubernetes, GitHub Actions) while JSON is the language of APIs. This bidirectional converter automatically detects whether you pasted YAML or JSON and produces the opposite format, preserving nested structures, lists and data types. It uses js-yaml with the safe schema, 2-space indentation and no anchor references. Multi-document YAML (---) is not supported: convert documents one at a time. All processing happens in your browser.

About this tool

YAML dominates modern configuration (Docker Compose, Kubernetes, GitHub Actions) while JSON is the language of APIs. This bidirectional converter automatically detects whether you pasted YAML or JSON and produces the opposite format, preserving nested structures, lists and data types. It uses js-yaml with the safe schema, 2-space indentation and no anchor references. Multi-document YAML (---) is not supported: convert documents one at a time. All processing happens in your browser.

Use cases

  • Convert Kubernetes or Docker Compose configs to JSON for APIs
  • Turn JSON responses into readable YAML for documentation
  • Migrate configuration files between formats
  • Inspect complex YAML in a structured JSON view

Frequently asked questions

How does auto-detection work?
In 'Auto' mode the tool first tries to parse the input as strict JSON; if that fails, it interprets it as YAML. The result is generated in the opposite format to the detected one.
Are multi-document YAML files (---) supported?
No. If the YAML contains more than one document, an error is shown asking you to convert each document separately.
What happens to YAML anchors and references (& and *)?
They are resolved to their values when converting to JSON. When generating YAML from JSON no references are created: the whole structure is written expanded.
Is my data sent to a server?
No. The whole conversion runs locally in your browser; nothing is uploaded or logged.

Related tools