YAML to JSON
Convert between YAML and JSON in both directions, right in your browser. No upload required.
How it works
This converter uses the js-yaml library and your browser's built-in JSON.parse and JSON.stringify to translate between formats entirely on your device. Pick a direction, paste your data, and the output updates as you type. YAML to JSON parses the YAML into a value and serializes it as JSON with your chosen indentation; JSON to YAML does the reverse. Invalid input is reported with the line and column of the problem where the parser can locate it.
Your data never leaves your browser. No server, no signup, no tracking. It works on any modern browser, on both mobile and desktop.
Frequently asked questions
Which YAML version does it support?
It parses YAML 1.2 using the js-yaml default schema, which covers the common subset used for configuration files: mappings, sequences, scalars, anchors, and multi-document streams are handled the same way most tooling handles them. Anchors and aliases are resolved into plain values on the way to JSON.
Why is my JSON to YAML output using spaces instead of tabs?
The YAML specification does not allow tab characters for indentation, so this tool offers 2 or 4 spaces only. Both are valid for the JSON side as well, which keeps a round trip between the two formats consistent.
Does converting change my data?
Values are preserved, but formatting is normalized. Comments are dropped because JSON has no place to keep them, key order follows the parsed structure, and numbers are re-serialized so redundant forms like 1.0 collapse to 1. The meaning of the data stays the same even when the text is not byte-for-byte identical.
Can it handle multiple YAML documents in one input?
Converting to JSON reads a single document. If your input contains multiple documents separated by ---, split them first and convert each on its own, since JSON represents one value per document.
More tools from Clean.tools
Use Clean.tools from your AI agent
This tool is also convert_yaml on the Clean.tools MCP server — the same engine, callable by your AI agent directly. No key, no signup: requests are processed in memory and request contents are never stored.
claude mcp add --scope user --transport http clean-tools https://mcp.clean.tools/mcpclaude mcp add --scope user --transport http clean-tools https://mcp.clean.tools/mcphttps://mcp.clean.tools/mcphttps://mcp.clean.tools/mcpEvery tool, the REST API, and setup for Cursor, Claude Desktop, VS Code & more →