YAML ↔ JSON Converter
Convert YAML and JSON data bidirectionally in the browser.
Category: Converters
When to use?
Use it to convert YAML config files like Docker Compose, Kubernetes, and GitHub Actions to JSON, or to tidy a JSON API response into YAML. All conversion runs in the browser; data is not sent out.
How to use
- Choose the direction (YAML → JSON or JSON → YAML).
- Paste the data to convert.
- Review and copy the result.
Input Explanation
YAML is indentation-based; JSON is brace-based. Objects, arrays, strings, numbers, and booleans are supported.
Calculation Basis
It parses the indentation-based YAML into a JS object with the browser JSON parser and js-yaml, then serializes to JSON, or the reverse.
Usage Examples
- Convert config files - Convert YAML config so JSON-based tools can read it.
- Tidy API examples - Turn a JSON sample into YAML for documentation.
- Check data structure - Verify that YAML parses into the intended JSON structure.
Examples
- YAML: "name: John\nage: 30" → JSON: {"name":"John","age":30}
- Paste a GitHub Actions workflow YAML → convert the indented structure into a JSON object
Cautions
- Input data is processed only in the browser and not sent to a server.
- Advanced YAML features like anchors (&) or merge keys (<<) may not be supported.
Guides
YAML vs. JSON
JSON is a strict brace-and-quote data format; YAML is an indentation-based format that is easy for humans to read.
Check syntax before converting
YAML is sensitive to indentation and colon placement. On a conversion error, check indentation, array notation, and string quoting first.
FAQ
Is conversion sent to a server?
No. Input data is parsed and converted only in the browser.
Does it handle complex YAML?
It supports common objects, arrays, strings, numbers, and booleans.
How are comments handled?
YAML comments have no JSON equivalent, so they disappear when converting to JSON.
What if the indentation is wrong?
YAML expresses structure with indentation, so misaligned indentation shows a parse error.
Related Tools
- TOML ↔ JSON Converter - Convert TOML config and JSON data bidirectionally in the browser.
- INI ↔ JSON Converter - Convert INI config files and JSON data to each other.
- JSON Formatter - Beautify or minify JSON strings instantly and check for validity errors.
- CSV ↔ JSON Converter - Convert CSV and JSON array data bidirectionally.
- Query String ↔ JSON Converter - Convert URL query strings and JSON objects bidirectionally.
- URL Encode / Decode - Encode text into URL-safe form (%XX) or decode an encoded URL back to text.