JSON YAML Converter: Convert Between JSON and YAML
Bidirectional JSON and YAML conversion in this browser. JSON follows RFC 8259. YAML is a documented 1.2 Core subset: maps, lists, and JSON-safe scalars. Remote tags, merge keys, anchors, aliases, and unsafe types are refused. Supported documents round-trip as data. Nothing leaves this page.
Drop a .json file here. Client-only FileReader. Nothing is uploaded.
Drop a .yaml or .yml file here. Client-only FileReader. Nothing is uploaded.
Supported JSON and YAML subset
JSON input is RFC 8259: one value of object, array, string, number, true, false, or null. Duplicate object keys are errors. Trailing commas and comments are errors. UTF-8 text is assumed.
YAML input is a YAML 1.2 Core subset: one document; block and flow maps and lists; plain, single-quoted, and double-quoted scalars; literal | and folded > block scalars; nested spaces; line comments (dropped on the JSON side because JSON has no comments); and JSON documents, which YAML 1.2 treats as valid YAML. Core types are null, true/false, decimal/hex/octal integers, floats, and strings. yes, no, on, off, and NO stay strings.
Refused with a line and column (never silently rewritten): tags (!, !!, !<uri>, remote tag URIs), anchors, aliases, merge keys (<<), explicit complex keys (?), %TAG, multi-document streams, .inf/.nan when writing JSON, tabs used as indentation, and any value that is not JSON-safe. The converter never builds host objects and never uses eval.
How to read results
- Choose a direction, paste into the source pane, then Convert. Options change the next conversion.
- Status uses an “OK:”, “Error:”, or “Note:” prefix plus color, so success is not color-only.
- Round-trip means the converted text parses back to the same JSON-safe data. YAML comments, quoting style, and indentation are presentation and are not preserved through JSON.
- Auto quote wraps strings that YAML 1.2 Core or YAML 1.1 would read as another type, including yes and leading-zero numbers.
- Integers outside JavaScript’s safe integer range stay digit strings so conversion does not silently round them.
- A parse error names line and column. In block YAML, key:value without a space is a plain string, not a mapping.
Privacy
Conversion runs locally in this page. There is no network request, no account, and no persistent browser storage. File load uses FileReader in the browser. Reset clears both editors and the options.