Convert between JSON and YAML syntax
Seamlessly convert config files and API payloads between clean YAML and strict JSON.
Developer Guide & FAQs
Learn how JSON Lab processes, formats, validates, and converts data securely in your browser.
100% Client-Side Data Protection
All data processing, formatting, syntax validation, and conversion occurs strictly within your web browser JavaScript engine. No JSON payloads are transmitted to external servers, APIs, or databases.
Instant Execution & Large File Support
Built with high-performance vanilla JS to handle large JSON documents instantly. Seamlessly view collapsible tree nodes, format payloads, sort keys alphabetically, and download structured outputs with one click.
Seamless Multi-Format Conversion
Effortlessly convert JSON arrays and objects to CSV spreadsheets, YAML configurations, XML documents, SQL queries, or TypeScript interfaces. Import via direct file upload or CORS-enabled API endpoints.
Converting between JSON and YAML
JSON and YAML represent the same data types. YAML is technically a superset of JSON. In practice they feel very different. YAML uses indentation instead of braces, lets you omit most quotes, and supports comments. JSON uses explicit delimiters, requires quotes on all strings, and has no comment syntax.
Type correspondence between formats
A few details matter in conversion: strings that look like other types in YAML need quotes. In YAML, true without quotes is a boolean, not the string "true". The same applies to yes, no, on, and off. YAML anchors and aliases are resolved during conversion. YAML comments are dropped when converting to JSON.
When to use each format
YAML works well for files that developers edit by hand: CI configuration, Kubernetes manifests, Ansible playbooks. The absence of braces and comment support make it easier to write and maintain. JSON works better for data exchange between services: it is faster to parse and natively supported by all HTTP libraries.
Frequently asked questions
Q: What happens to YAML comments when converting?
A: They are dropped. JSON has no comment syntax.
Q: My YAML string "true" appeared as a boolean in JSON. Why?
A: YAML treats unquoted true as a boolean. Quote the value in YAML to keep it as a string.
Q: Can I convert multi-document YAML files?
A: Multi-document YAML (separated by ---) is converted to a JSON array where each document becomes an element.