Free Online YAML to JSON and JSON to YAML Converter
Turn YAML into JSON or JSON into YAML, with the indent, line width, quoting style and flow level in your hands. A file holding several documents can come out as the first one or as an array of all of them, and a mistake is reported with its line and column.
Enjoying WizTools123? Help keep our server infrastructure 100% free and open for everyone.
How to Use JSON and YAML Converter
Step by step, start to finish.
Press Sample to load an example for the direction you are in. It converts as you type and nothing is uploaded.
YAML to JSON, or JSON to YAML. The options change, because each direction needs different questions answered.
Going to JSON: how many documents to take and the indent. Going to YAML: indent, line width, quoting, sorting and flow level.
Anything that changed shape, such as a timestamp becoming a string, is reported above the counts. Then copy or download.
Key Features
What this tool does, and what it does not do.
YAML to JSON and JSON to YAML, each with its own options.
A file split on --- gives you the first document or an array of all.
Indent, line width, quoting style, sorted keys and flow level.
A line and a column from either parser, not a vague complaint.
Timestamps, anchors and byte strings are counted and reported.
Manifests hold hostnames and tokens. Parsing happens in your tab.
About JSON and YAML Converter
JSON and YAML hold nearly all the configuration in modern infrastructure. Kubernetes, GitHub Actions, Docker Compose and Ansible lean on YAML because humans have to read and edit it; APIs, build tools and package manifests lean on JSON because machines have to parse it unambiguously. Converting between them comes up whenever a file has to cross that line.
This page does both directions with js-yaml in your browser. Going to JSON you choose whether a multi-document file becomes its first document or an array of all of them, and what the layout should be. Going to YAML you get the indent, the wrap width, the quoting style, sorted keys and the depth at which it switches to inline braces. Either way a syntax error comes back with the line and the column it was found on.
The part worth being careful about is the direction that loses something. JSON going to YAML is straightforward, because YAML can express everything JSON can. YAML going to JSON needs a few decisions, because dates, anchors, binary values and multiple documents have no direct JSON equivalent. Rather than convert silently, the page counts those cases and tells you what it did, so a date quietly becoming a string is something you find out here instead of downstream.
Frequently Asked Questions
Common questions about this tool.
More Developer Tools
Other tools from the same hub, free and in your browser.
Feedback
No feedback on this tool yet. Yours would be the first.