OnlineNotes Logo

    YAML to JSON Converter

    Paste YAML from a config file, a Kubernetes manifest or a CI pipeline and get formatted JSON as you type. Switch the direction to turn JSON into YAML.

    Options

    About this tool

    YAML and JSON hold the same kind of data: maps, lists, strings, numbers, true, false and null. YAML is easier to write by hand, so tools like Docker Compose, Kubernetes, GitHub Actions and OpenAPI use it. JSON is what most code and APIs read, so you often need to convert one into the other to debug a config, feed it to a script or paste it into a request.

    This converter follows YAML 1.2, the current version. That matters for a few values: yes, no, on and off stay text, not true and false as in YAML 1.1, and a version like 1.10 becomes the number 1.1. Put such values in quotes when they must stay text. Comments are dropped, because JSON has no comments.

    How it works

    1. Paste YAML (or JSON, after you switch the direction) into the input box.
    2. The text is parsed in your browser with the open source yaml library. Nothing is uploaded.
    3. Anchors (&) and aliases (*) are expanded, and merge keys (<<) are applied.
    4. If the input has more than one document (split by ---), the JSON output is a list with one item per document.
    5. A syntax error shows its message and line, and the last good result stays visible.

    Edge cases and limits

    • Comments and the order of keys in YAML anchors are not kept in JSON.
    • Custom tags such as !Ref in AWS CloudFormation are read as plain values, without the tag.
    • Very large integers above 2^53 lose precision, the same as in JavaScript JSON.
    • Dates are kept as text, for example 2026-11-15, not converted to a timestamp.

    Frequently asked questions

    Is my YAML uploaded anywhere?

    No. The conversion runs in your browser. You can disconnect from the internet after the page loads and it still works.

    Why did "yes" not become true?

    YAML 1.2 treats only true and false as booleans. yes, no, on and off are text. YAML 1.1 tools (older PyYAML) read them as booleans.

    Can I convert JSON to YAML?

    Yes. Choose JSON to YAML in the direction menu. Any valid JSON is also valid YAML, so the tool can read it and write it in YAML style.

    What happens to YAML comments?

    They are removed. JSON has no comment syntax.

    Related tools