YAML to JSON Converter

Convert YAML into JSON and JSON back into YAML.

Developer Tools Free, no sign-up Runs in your browser

YAML to JSON Converter tool

Direction

About the YAML to JSON Converter

YAML to JSON converts between the two formats configuration lives in. YAML is pleasant to write and unforgiving about indentation; JSON is noisy to write and completely unambiguous. Moving between them is a daily job for anyone working with CI pipelines, Kubernetes manifests or application config.

The parser covers the YAML that appears in real configuration files: nested maps and sequences, quoted and unquoted scalars, block scalars with the pipe and greater-than indicators, inline flow collections, comments, multiple documents separated by three dashes, and the usual scalar types including booleans, nulls, integers and floats.

It does not implement the full YAML specification, which is substantially larger than most people realise and includes features such as anchors, aliases, merge keys and custom tags. Those are reported clearly rather than being misread, so you are told what is unsupported instead of receiving quietly wrong output.

How to use the YAML to JSON Converter

  1. Choose a directionYAML to JSON, or JSON to YAML.
  2. Paste your documentA configuration file, a manifest or an API response.
  3. Press ConvertThe result appears, or a message naming the line that failed.
  4. Copy or downloadTake the converted file.

Features

  • YAML to JSON and JSON to YAML
  • Nested maps and sequences at any depth
  • Block scalars with literal and folded styles
  • Inline flow collections
  • Comments handled and preserved where the format allows
  • Multiple documents separated by three dashes
  • Clear errors naming the line and the problem
  • Unsupported features reported rather than misread

Who uses this tool

The yaml to json converter is used by writers, developers, students, marketers and anyone else who needs the job done once without installing software. Common cases include:

  • Converting a CI pipeline config to inspect it as JSON
  • Turning a JSON API response into readable YAML
  • Checking that a manifest's indentation is valid
  • Moving configuration between two tools
  • Finding the line where a YAML file goes wrong

Frequently asked questions

Why does my YAML fail with an indentation error?

Because YAML uses indentation for structure and forbids tabs entirely. A single tab anywhere in the file, or a line indented by an amount that does not match its siblings, makes the document invalid. The error names the line.

Which YAML features are not supported?

Anchors and aliases, merge keys, custom tags and a few rarer constructs. They are detected and reported rather than guessed at, because misreading configuration is worse than refusing it.

How are booleans handled?

The strings true and false become booleans, as do yes and no, which is a long-standing YAML quirk that surprises people. If you need the literal word yes as a string, quote it.

What happens to comments when converting to JSON?

They are discarded, because JSON has no comment syntax. Converting back therefore does not restore them, which is worth knowing before using a round trip as an editing workflow.

Does JSON to YAML produce valid YAML?

Yes. Keys needing quotes are quoted, strings that would be read as another type are quoted, and nesting is indented consistently.

Is my configuration uploaded?

No. Parsing runs in your browser, which matters because configuration files frequently contain internal hostnames and secrets.

If the yaml to json converter is not quite what you need, these other free tools solve closely related problems.

JSON Formatter

Pretty-print and validate JSON, with the exact line and column of any error.

Developer Tools Use tool

XML Formatter

Pretty-print XML with proper indentation, and catch malformed documents.

Code Formatters Use tool

CSV to JSON Converter

Turn spreadsheet data into JSON, or JSON records back into CSV rows.

Developer Tools Use tool

JSON Minifier

Strip whitespace from JSON and compare original and minified sizes.

Developer Tools Use tool

Cron Expression Generator

Generate cron expressions from a schedule, and explain ones you already have.

Developer Tools Use tool