Skip to content

YAML to JSON

Turn YAML config files into JSON in one step.

How to convert YAML to JSON

Three steps, all in your browser.

  1. 1

    Paste or open your data

    Drop a file or paste rows straight into the input box.

  2. 2

    Check the options

    Delimiter, header row, indentation: the output updates live.

  3. 3

    Download

    Save the converted file, or copy the output.

YAML to JSON: what to know

YAML is the human-friendly format behind many configuration files, from Kubernetes and Docker Compose to GitHub Actions and OpenAPI specs. JSON carries the same data in a stricter form that every language and API reads. This converter reads YAML in your browser and writes the same data as JSON.

The file is read as YAML 1.2, the current version of the spec. Only true and false are booleans, so yes, no, on and off stay strings, and dates such as 2024-05-01 stay text instead of being turned into timestamps. Anchors and aliases are expanded, and block, flow and multi-line strings are all supported. Comments are dropped because JSON has none.

A file with several documents separated by --- becomes one JSON array with an entry per document, and the converter says so. Syntax errors, such as a bad indent or an unclosed bracket, are reported with their line and column so you can fix them in your editor.

Popular uses

  • Checking what a Kubernetes or Compose file really contains
  • Feeding YAML configuration into a tool that only reads JSON
  • Turning an OpenAPI spec from YAML into JSON
  • Debugging indentation mistakes in a YAML file

Tips for the best result

  • Indent with spaces only; tabs aren't allowed for indentation in YAML.
  • Quote values like "no" or "1.0" in your YAML if you want to be sure they stay strings everywhere.
  • Use 0 indentation for compact JSON, or 2 or 4 spaces for readable JSON.

Read how JustYourConvert works and our privacy details. Keep your original files and check a converted file before you replace anything.

Frequently asked questions

Documents separated by --- are combined into one JSON array, one entry per document, and the converter notes that it did so. Kubernetes manifests often hold several documents like this.

The file is read as YAML 1.2, so yes and no stay strings and dates stay text such as "2024-05-01". Only true and false are booleans. This avoids the surprises of older YAML 1.1 parsers.

No. Every live tool on JustYourConvert opens and converts your files inside your browser, on your own device. Nothing is sent to our servers, and the result is saved straight from your browser.

Yes. Every tool is free, with no sign-up, no watermark and no daily limit. Clearly labeled ads keep it that way.

Only your device's memory. Because the work happens in your browser, very large files can be slow on phones and older computers. Each tool says its practical limit under the drop area.