Data convertersFreeNo uploadNo sign-up
YAML to JSON Converter
Paste YAML and get valid JSON instantly, pretty-printed or minified. Upload a .yml file or download the result.
Runs in your browser. Your data is never sent to a server.
How to use the YAML to JSON
Paste or upload YAML
Paste YAML into the left box, drop a .yaml or .yml file, or click Sample.
Choose the output
Pick a 2 or 4 space indent or minified JSON. Syntax errors show the line and column.
Copy or download JSON
The JSON updates as you type. Copy it or download it as a .json file.
Why use this tool
APIs, JavaScript code and most databases expect JSON, while configuration usually lives in YAML. Converting YAML to JSON is the quickest way to feed a config into a script, validate it against a JSON Schema or send a Kubernetes manifest to an API.
The converter resolves YAML features that JSON does not have: anchors and aliases are expanded, multi-line strings are joined correctly and several documents separated by --- become a JSON array. Comments are dropped, because JSON has no place for them.
Frequently asked questions
How do I convert YAML to JSON?
Paste the YAML on the left or upload a .yaml or .yml file. Valid JSON appears on the right; copy it or download it.
What happens to YAML comments?
They are removed. JSON does not support comments, so there is nowhere to keep them.
Does it support anchors and multiple documents?
Yes. Anchors (&) and aliases (*) are expanded into full values, and multiple documents become a JSON array.
How do I convert YAML to JSON in Python?
json.dumps(yaml.safe_load(open("config.yaml")), indent=2) with PyYAML installed. For several documents use list(yaml.safe_load_all(f)).
Are my files uploaded to a server?
No. formatmath converts files with code that runs inside your browser. Your files are never uploaded, stored or seen by us.
Is it free?
Yes. There is no watermark and no daily limit. An account is optional and only keeps a history of your conversions.