Convert YAML to JSON and JSON to YAML in either direction, with js-yaml in your browser. Your data never leaves the page.
Convert between YAML and JSON locally with js-yaml. Nothing is uploaded.
What the YAML / JSON converter does
Switch between YAML and JSON in either direction. YAML is the format used by many configuration files and Kubernetes manifests, while JSON is what most APIs exchange. The conversion runs in the page with js-yaml, so your data stays on your device.
Frequently asked questions
Why would I convert YAML to JSON?
Many tools and APIs only accept JSON. Converting lets you paste a config file and get a JSON block you can drop into code or a request body.
Does it preserve order and nesting?
Yes. Objects keep their key order and nested structures become nested objects or arrays in the other format.
Is my data uploaded?
No. Parsing and serialisation happen entirely in the browser.
How to use it
- Paste your YAML or JSON source data into the top input box labeled
input. - Select the conversion direction by clicking y2j to turn YAML into JSON, or j2y to turn JSON into YAML.
- Wait for the bottom input box to populate with the converted output automatically.
- Copy the result from the second input box and paste it into your editor, API request body, or configuration file.
Where it comes in handy
A Docker Compose file typically runs 60 to 120 lines in YAML. If a deployment script expects JSON, pasting the entire compose file into the converter produces a single nested JSON object you can reference directly in a .env loader or automation pipeline without manual rewriting.
Kubernetes manifests often contain deeply nested field structures. A typical Deployment resource can exceed 200 lines. Running it through this converter yields compact JSON that some CLI tools and testing frameworks parse more reliably than their YAML counterparts.
When migrating between services, you may need to transform a 50-entry configuration block from one format to another. Pasting the source, selecting the correct direction, and copying the output avoids transcription errors that commonly introduce missing quotes or mismatched indentation.
Worth knowing
- js-yaml follows YAML 1.1 boolean rules by default, so bare values like
on,off,yes, andnoare parsed as booleans. Wrap them in quotes if you need literal strings. - Dates written in YAML as
2024-01-15are parsed into JavaScript Date objects, then serialized back as ISO timestamp strings in JSON. This changes the original text representation. - YAML supports multiline strings with
|and>syntax. These convert into single JSON strings with literal or folded line breaks respectively; tabs are not preserved unless explicitly encoded.