YAML to JSON Converter

Convert YAML to JSON online for configs and Kubernetes files — free and instant.

About

About the YAML to JSON Converter

Paste a YAML file — a Kubernetes manifest, a GitHub Actions workflow, a config file — and get valid JSON back instantly, parsed with js-yaml so anchors, aliases and merge keys are resolved and unquoted numbers, booleans and dates get their proper types, the way a real YAML 1.2 parser reads them.

A few YAML details carry over in ways worth knowing: comments are dropped, because JSON has no comments, and anchors and aliases are expanded so every reference becomes a full copy. Unquoted dates like 2024-05-01 are read as timestamps and come out as "2024-05-01T00:00:00.000Z" — quote them in the YAML if you want the plain date string.

Choose what to view about this tool

Guide

Using the YAML to JSON Converter

  1. 1

    Step 1

    YAML to JSON is already the button to use — JSON to YAML works the other way.

  2. 2

    Step 2

    Paste your YAML into the input box.

  3. 3

    Step 3

    Click "YAML → JSON" to see the converted JSON in the output box.

  4. 4

    Step 4

    Copy the JSON to use in your application or config.

  • Outputs JSON with a 2-space indent
  • Expands anchors, aliases and << merge keys into full values
  • Shows the line and column of YAML syntax errors
  • Copy the result in one click
  • Loads the conversion library from this site the first time you use it
  • Runs in your browser — free, with no sign-up and nothing uploaded

Backend developers

Developers load a YAML config in code or tools that only read JSON.

DevOps engineers

Engineers inspect a Kubernetes or GitHub Actions file as JSON, or pipe it into jq.

API developers

Developers turn a YAML OpenAPI spec into JSON for tools that need it.

Anyone debugging indentation

Anyone fighting a YAML indentation bug sees exactly how the file is parsed.

Convert the other direction

Examples

YAML to JSON Converter examples

4 worked examples

01

Converting a Kubernetes-style manifest

Pasting a short manifest starting with "apiVersion: v1\nkind: Pod" converts to {"apiVersion":"v1","kind":"Pod"}.

02

Booleans versus yes and no

"enabled: true" converts to "enabled": true, while "enabled: yes" stays the string "yes" — YAML 1.2 only treats true and false as booleans.

03

Resolving an anchor

"base: &b {x: 1, y: 2}" followed by a child that uses "<<: *b" and sets y: 3 converts to a child of {"x": 1, "y": 3} — the merged values are written out in full.

04

Quoted versus unquoted

"version: 1.10" converts to the number 1.1, while "version: '1.10'" stays the string "1.10".

FAQ

Frequently asked questions

Quick answers to common questions about the YAML to JSON Converter.

How do I convert YAML to JSON?

Paste your YAML above and click "YAML → JSON". The converted JSON appears in the output box — everything runs in your browser, using the js-yaml library.

Does it support YAML anchors and multi-document files?

Anchors, aliases and << merge keys are fully supported — js-yaml resolves them, so the JSON contains the real values. Multi-document files are not: a single leading --- is fine, but two documents separated by --- give an error, so paste one document at a time.

What happens to YAML's implicit types, like unquoted yes or no?

js-yaml follows YAML 1.2, so only true and false (in any capitalisation) become JSON booleans — unquoted yes, no, on and off stay as strings. Unquoted numbers become JSON numbers, and ~ or null become null.

Is this YAML to JSON converter free?

Yes. It's free, with no sign-up and no limit on how much you convert.

Can I convert JSON back to YAML?

Yes — the same tool handles both directions. Click "JSON → YAML" instead, or use the dedicated JSON to YAML converter page.

Is my YAML sent anywhere when I convert it?

No. The conversion runs directly in your browser — nothing is uploaded to a server.

Why did 0755 or 007 lose their leading zeros?

YAML 1.2 reads an unquoted 0755 as the decimal number 755 and 007 as 7. Put the value in quotes — mode: "0755" — to keep it as text. A real octal number needs the 0o prefix, so 0o755 is read as 493.

Why did my version number 1.10 become 1.1?

An unquoted 1.10 is a number in YAML, and as a number it equals 1.1. Quote version strings, as in version: "1.10", so they stay exactly as written.

What happens to dates?

Unquoted dates like 2024-05-01 are read as timestamps and come out in full ISO format, such as "2024-05-01T00:00:00.000Z". Quote the date if you want to keep it exactly as typed.

Still have a question? Contact us

Report a problem

YAML to JSON Converter

What went wrong?
    or paste a screenshot