YAML to JSON Converter

Paste YAML and get clean JSON in real time.

Processed locally — nothing is uploaded

About Code Formatter

Useful for making a minified payload readable again, for checking that a config parses before you ship it, or for stripping a file down for production. Switching language keeps whatever you have already pasted.

Convert a YAML config file into equivalent, valid JSON — handy for feeding pipelines, APIs or tools that only accept JSON. Your YAML is parsed in the browser, so secrets in your config stay on your machine.

Paste messy or minified code and instantly beautify, minify or validate JSON, HTML, CSS, SQL, XML and YAML. Beautifying re-indents your source with consistent spacing so it is easy to read and review; minifying strips whitespace and comments to ship smaller files; validating surfaces syntax errors with the exact location so you can fix them fast.

It also doubles as a converter between common data formats — JSON to CSV, CSV to JSON, YAML to JSON and back — which is handy when wiring up APIs, configs or spreadsheets. Converting is where structure mismatches surface: CSV has no nesting, so a nested JSON object has to be flattened or dropped.

Learn how this works

Frequently asked questions

How are YAML anchors and aliases converted?

They are resolved before conversion, so an aliased block is expanded into its full value in the JSON output. JSON has no equivalent of anchors, so what you get is the flattened result — which is exactly what a YAML parser would have handed your application.

Why did my YAML value become a different type in JSON?

YAML's implicit typing is aggressive: unquoted `yes`, `no`, `on` and `off` become booleans, and `1.0` becomes a number. If a value must stay a string, quote it in the source YAML before converting.

Is it safe to paste a config file with secrets in it?

Conversion runs entirely in your browser and nothing is uploaded, so credentials in a config never leave your device. Redact them anyway before pasting the JSON result anywhere else.

Pro Tips

  • Paste unformatted JSON, HTML, CSS, or SQL code and apply consistent indentation (2, 4, or tab spaces) in one click.
  • Use minification toggle to reduce code size by 30-50% for production deployment or email constraints.
  • Export formatted code directly to clipboard to paste into documentation, emails, or config files instantly.
  • Compare formatted vs minified side-by-side to verify code compression doesn't break syntax.

Common Use Cases

  • Feeding a YAML config into an API or tool that only accepts JSON
  • Checking exactly how a CI or Kubernetes file will be parsed before committing it
  • Diffing a YAML file against a JSON one by putting both in the same format

How It Compares

While Prettier and VS Code extensions require installation and configuration, our web-based formatter works instantly on any device without setup, offering broader language support (HTML, CSS, SQL) in a single tool compared to language-specific formatters like Beautifier.io.

More Code Formatter tools

Related tools