YAML to JSON Converter
Convert YAML into JSON or JSON into YAML, with configurable indentation. Handles nested maps, lists and multi-line strings, and reports exactly where a
Convert YAML into JSON or JSON into YAML with configurable indentation. Nested maps, lists, quoted strings, multi-line block scalars and anchors are handled, and a syntax problem is reported with the position that caused it instead of failing silently.
This is the everyday bridge between the two formats: a Kubernetes or CI configuration file written in YAML needs to become JSON for an API call, or a JSON payload has to be edited by hand, which is far easier in YAML. Conversion happens in your browser, so configuration files containing tokens or internal hostnames never leave your machine.
How to convert between YAML and JSON
Paste YAML or JSON
Choose the direction and indentation
Copy the converted output
FAQ
Which direction is supported?
Both: YAML to JSON and JSON to YAML. JSON is a subset of YAML, so valid JSON always converts cleanly, while YAML uses features JSON does not have - those are expanded when converting.
What happens to comments in my YAML?
Comments are not part of the data model, so they are dropped when converting to JSON. Keep the original file as the source of truth if the comments matter.
Are multi-line strings preserved?
Yes, block scalars and literal strings become regular strings in JSON, with the line breaks kept as escaped newline characters.
Why does my YAML fail to parse?
The usual causes are inconsistent indentation, a tab character instead of spaces, or an unquoted colon inside a value. The error message points at the line and column where parsing stopped.
Can it handle large configuration files?
Yes, files of a few megabytes convert instantly. The practical limit is your device memory, and everything is processed locally.
Is my configuration uploaded?
No. That matters because config files often contain credentials, tokens and internal hostnames.
At a glance
| Input | text |
|---|---|
| Multiple files | No |
| Where it runs | In your browser - files are never uploaded |
| Works offline | Yes — once the page has loaded |
| Price | Free, no sign-up, no watermark |
Choosing a data format
JSON is the default for anything an API returns or a program reads: it handles nested structures, numbers, booleans and null naturally, and every language parses it. CSV is smaller and opens straight into a spreadsheet, but it has no way to express nesting and no shared standard for the delimiter, quoting or character set - which is exactly where conversions go wrong. XML is verbose but carries attributes, mixed content and schemas, so it still dominates document formats and legacy integrations. YAML is the most readable for configuration but is whitespace-sensitive and has surprising type coercion ("no" becoming false, a version like 1.10 becoming 1.1). Pick the format the consuming tool prefers rather than the one that looks nicest.
Where conversions quietly break
Most conversion bugs are not about syntax, they are about meaning. A CSV column of postcodes loses its leading zeros the moment a spreadsheet guesses it is a number; a long ID exceeds floating-point precision; dates change meaning depending on whether they are day-first or month-first. JSON keys are unordered but arrays are not, and a tool that sorts keys changes nothing while one that sorts arrays changes the data. Unicode is another trap: text can arrive as UTF-8, UTF-16 or with a byte-order mark, and a decoder that guesses wrong turns accented characters into mojibake. Before trusting any conversion, spot-check the first and last row, any field with leading zeros, and any field containing quotes, commas or newlines.