YAML to JSON converter

Paste YAML, choose your indentation and get JSON instantly. Supports YAML anchors and multiple documents.

Ready to copy or download

Ready.

🔒 Text is processed on your device, not uploaded by this tool.

Convert YAML to JSON safely

YAML is common in Kubernetes manifests, Docker Compose files, CI pipelines and application configuration. JSON is often easier to consume in JavaScript programs, validation tools and APIs. This converter parses YAML in your browser and serializes the resulting data as JSON.

What happens to anchors, comments and multiple documents?

YAML anchors and aliases are resolved during parsing. Comments and original whitespace cannot be represented in ordinary JSON, so they are not preserved. If you paste multiple documents separated by ---, the tool places their parsed values into a JSON array. Review the output before using it in production.

Example: simple service configuration

service:
  port: 8080
  enabled: true
  hosts:
    - api.example.com

This becomes a JSON object with service.port as a number, service.enabled as a boolean and service.hosts as an array. A quoted value such as "8080" would remain a string.

Frequently asked questions

Does the converter send my YAML to a server?

No. Conversion itself runs locally in the page. The page loads the open-source js-yaml parser from jsDelivr, which receives an ordinary request to deliver the script, but your editor content is not sent to it by this tool.

What if the YAML contains a syntax error?

The tool reports the parser error and, when available, its line and column. Check indentation, colons, quotation marks and tab characters.

Does YAML support multiple documents?

Yes. Separate them with a line containing ---. For more than one document, this tool outputs a JSON array.

Working with JSON next?

Need the opposite direction? Try our JSON to YAML converter.

Use our JSON formatter to validate, indent or minify the converted result.

Open JSON formatter →