YAML to JSON Converter · YAML JSON Bridge

Convert YAML to JSON and back, with warnings for ambiguous implicit-typing words. Your data never leaves your browser.

Updated:

100% client-side

Input

0 characters

Output


        
Implicit-typing warning
    —

    What the YAML to JSON converter does

    YAML and JSON are both ways to write structured data, but YAML uses indentation and looks closer to plain text (common in config files like Kubernetes manifests or CI pipelines), while JSON uses braces and brackets (common in APIs). YAML JSON Bridge converts a file from one to the other, and flags spots where YAML's "implicit typing" could silently turn a word like yes or no into a boolean instead of a string.

    How to use the YAML to JSON converter

    1. Choose a direction: YAML → JSON or JSON → YAML.
    2. Paste your content into the Input panel (or click Example to load a sample).
    3. The Output panel converts it instantly, with any implicit-typing warnings shown below it.
    4. Use Copy or Download to grab the result, or Clear to start over.

    How YAML/JSON conversion works

    YAML 1.2 and JSON share the same underlying data model (mappings, sequences, scalars), so converting between them is mostly a matter of re-serializing the same parsed value. This tool uses a locally-bundled copy of js-yaml (no CDN, no server call) to parse and generate YAML, following YAML 1.2's core schema — the same schema used by modern parsers like Kubernetes' own YAML handling:

    // YAML in
    name: my-app
    replicas: 3
    tags: [web, api]
    
    // JSON out
    {
      "name": "my-app",
      "replicas": 3,
      "tags": ["web", "api"]
    }

    The one place this trips people up: under the older YAML 1.1 rules that some tools (older PyYAML, Ansible, some spreadsheet-to-YAML exporters) still follow, bare unquoted words like yes, no, on, off, y and n are read as booleans — the textbook case being Norway's ISO country code NO silently becoming the boolean false in a spreadsheet exported to YAML. This tool follows the stricter YAML 1.2 core schema and keeps those words as strings, but still flags every occurrence so you know a downstream YAML-1.1 tool might read your file differently — quote them ("no") if you mean the string.

    Examples

    1. Values that change type on the way to JSON. Under YAML 1.2, NO stays a string, but the tool still flags it (Line 1: unquoted "NO" — a YAML 1.1 parser may read this as a boolean, not a string.). The two silent ones are the version 1.10, which becomes the number 1.1, and the ZIP code 01234, which loses its leading zero. Quote all three if you mean text:

    // YAML
    country: NO
    version: 1.10
    zip: 01234
    on: push
    // JSON
    {
      "country": "NO",
      "version": 1.1,
      "zip": 1234,
      "on": "push"
    }

    For comparison, PyYAML, a YAML 1.1 parser, read the same text with python -c "import yaml; print(yaml.safe_load(...))" as {'country': False, 'version': 1.1, 'zip': 668, True: 'push'}: the country became a boolean, 01234 was read as octal, and even the key on turned into True.

    2. JSON strings that would look like something else in YAML. In JSON → YAML mode, strings such as "1.10" and "no" are written in single quotes so any YAML parser reads them back as strings; arrays become block lists and an empty object stays {}:

    // JSON
    {"name": "api", "version": "1.10", "debug": "no", "ports": [80, 443], "env": {}}
    
    // YAML
    name: api
    version: '1.10'
    debug: 'no'
    ports:
      - 80
      - 443
    env: {}

    For flat KEY=value config, the .env ↔ JSON Converter does the same job for .env files; to check what actually changed between two configs once both are JSON, use the JSON Diff. The parsing rules followed here are those of the YAML 1.2.2 specification.

    Frequently asked questions

    Is it safe to paste a Kubernetes manifest or secret here?

    Yes. All parsing happens in your browser using a locally-bundled copy of the js-yaml library; nothing is ever sent to a server.

    Why does the tool warn me about words like 'no' or 'yes'?

    Under the older YAML 1.1 rules that many real-world parsers still use, bare words like yes, no, on, off, y and n are read as booleans instead of strings — famously turning Norway's country code "NO" into false in a well-known spreadsheet-to-YAML bug. This tool follows the stricter YAML 1.2 core schema and keeps them as strings, but still flags them so you know a different tool downstream might disagree.

    Does it support multiple YAML documents in one file (--- separators)?

    No, this tool handles a single YAML document at a time, which covers the vast majority of Kubernetes and Docker Compose files.

    Does converting JSON back to YAML preserve quoted strings correctly?

    Yes. A JSON string value keeps its string type in the generated YAML, even if it looks like a number or boolean word — the tool quotes it when needed so it round-trips correctly.