YAML Formatter

How to use

Reformats YAML with consistent indentation, and converts between YAML and JSON in either direction. Handy for editing config files like docker-compose or CI pipelines. Paste your YAML or JSON, pick the direction you need, and copy the output. Anchors, tags and multi-document files are not supported.

Developer PopularLocal only

Note: this is a lightweight YAML implementation for typical config-style files (nested maps/lists, flow arrays/objects, scalars). Anchors, tags, multi-line block scalars, and multi-document files are not supported.

Input YAML
Output
Result will appear here...
When to use this
  • Cleaning up inconsistent indentation in a docker-compose.yml before committing it
  • Converting a YAML pipeline definition to JSON to feed into a tool that expects JSON input
  • Checking the equivalent JSON structure of a Kubernetes manifest for debugging
  • Reformatting a messy YAML config pulled from another team's repository

Free and private. Everything runs on your own device, with no account and no uploads.

DevOps engineers editing a docker-compose file or a CI/CD pipeline definition need consistent YAML indentation, and sometimes need to quickly check the equivalent JSON structure. This tool reformats YAML with clean, consistent indentation and converts between YAML and JSON in either direction, making it easier to review config files or feed data into tools that expect one format or the other.

No, anchors, aliases and custom tags are not supported, stick to plain key-value and list structures for reliable results.

Multi-document YAML files are not supported; format or convert one document at a time.

Since YAML structure depends on indentation, inconsistently indented input can be parsed incorrectly or reported as invalid, fix indentation before formatting.

No, JSON has no concept of comments, so any comments in the YAML are dropped during conversion.

How it works
  1. 1

    Paste YAML or JSON

    Add your source content into the input box.

  2. 2

    Pick a conversion direction

    Choose to format YAML, or convert YAML to JSON or JSON to YAML.

  3. 3

    Review the output

    Check the formatted or converted result for correctness.

  4. 4

    Copy the result

    Copy the output into your config file or codebase.

Pro tips
  • ·Fix indentation issues in the source before formatting, YAML structure depends on indentation, so inconsistent spacing can be misread.
  • ·Avoid anchors, aliases and multi-document files split by "---" since neither is supported here.
  • ·Remember comments are dropped when converting YAML to JSON, since JSON has no comment syntax, keep a copy of the original if comments matter.