Convert YAML to JSON
Paste a config file, a Kubernetes manifest, an OpenAPI spec or a GitHub Actions workflow and get JSON. If the YAML is broken, you see the line and column where parsing failed.
- Free
- Runs in your browser
- Errors with line numbers
- No sign-up
How It Works
Convert YAML in three steps.
Paste YAML
One document, or several separated by ---.
Check the JSON
Indented with 2 or 4 spaces, or minified.
Copy or download
Copy the JSON or save it as converted.json.
YAML and JSON: same data, different syntax
YAML is designed for people to write: indentation instead of braces, no quotes around most strings, comments. JSON is what most APIs and programs read. Every JSON document is valid YAML, but YAML has extras that need resolving when converting, such as anchors (&) and aliases (*) that reuse a block, and several documents in one file. The converter uses the yaml library with YAML 1.2 rules.
Comments are dropped, because JSON has no comments. Under YAML 1.2, values like yes, no and on stay strings; only true and false become booleans.
Error position
Indentation mistakes and stray characters are reported with their line and column.
Anchors and merge keys
&anchor, *alias and <<: merge keys are expanded, so the JSON contains the full values.
Multiple documents
A file with several --- documents becomes a JSON array, one item per document.
Alias limit
Documents that expand aliases into millions of values ("billion laughs") are refused instead of freezing the tab.
Convert PDF Files and File Formats
Find the perfect online tool to combine PDF files, compress documents, and handle your daily workflow effortlessly.
PDF Tools
All your PDF needs in one place
- Merge PDF
- Organize PDF
- Split PDF
- Compress PDF
- Convert to Word
- Convert to Image
Image Tools
Edit and optimize your images
- Resize Image
- Compress Image
- Convert Format
- Crop Image
- Add Watermark
- Remove Background
Word Tools
Work with Word documents
- Convert to PDF
- Merge Documents
- Split Documents
- Compress File
- Edit Text
- Add Watermark
Excel Tools
Process Excel spreadsheets
- Convert to PDF
- Convert to CSV
- Merge Sheets
- Split Sheets
- Compress File
- Clean Data
Why Use This Converter
Configs to JSON without a script.
Find the mistake
A line and column are faster than staring at indentation.
Multi-document files
Kubernetes manifests with several resources convert in one go.
Secrets stay local
Config files often hold keys and passwords; they are converted in your browser.
Save as a file
Download the result as converted.json.
Frequently Asked Questions
Questions people ask about the YAML to JSON converter.
This converter follows YAML 1.2, the current version, where only true and false are booleans. Older YAML 1.1 parsers such as PyYAML treat yes, no, on and off as booleans too.
They are removed. JSON has no comment syntax, so there is nowhere to keep them.
Plain dates such as 2025-01-31 are kept as text, so they come out unchanged in the JSON.
A JSON array with one element per document, in the same order as in the file.
Related Text & Developer Tools
More small utilities that run in your browser.