Utils365

Convert YAML to JSON

Turn YAML config into JSON, and find out exactly where it’s broken when it is.

Paste YAML, open a .yaml or .yml file, or drop one here. Several documents split by --- become a JSON array.

Next: JSON formatter · XML to JSON · JSON to CSV

Report a problem with this tool

How to use YAML to JSON

  1. Paste your YAML

    Paste YAML, or open or drop a .yaml or .yml file. It’s checked and converted as you type.

  2. Choose a layout

    Indent the JSON with 2 or 4 spaces, or minify it onto one line.

  3. Copy or download

    Copy the JSON, or download it as a .json file.

Why use Utils365

  • Anchors and merges resolved

    Aliases like *defaults and merge keys like <<: *defaults, common in docker-compose and Kubernetes files, are filled in.

  • Several documents at once

    A file with documents split by --- becomes a JSON array, one item per document.

  • Errors you can fix

    Bad indentation, tabs, duplicate keys and unclosed quotes are named with the line and column, and the line is shown with the spot marked.

  • Private by design

    Your YAML is converted on your device and never uploaded, so passwords and tokens in config files stay with you.

Frequently asked questions

What happens to a file with several documents?

Documents separated by --- become a JSON array, in order. A file with one document becomes a single JSON value.

Is yes converted to true?

No. This follows YAML 1.2, where only true and false are booleans, so yes, no, on and off stay as text. Write true or false if you mean a boolean.

Are anchors and aliases supported?

Yes. Each *alias is replaced by a copy of what its &anchor marks, and <<: merge keys are combined into the map. Files that expand aliases to an enormous size are stopped.

Why does my YAML show an error?

Common causes are tabs used for indentation, items that don’t line up, a key used twice in the same map, or a quote that isn’t closed. The message gives the line and column.

What happens to comments?

JSON has no comments, so YAML comments are left out of the result.