Tool guide
About this tool.
JSON and YAML describe the same kinds of data: objects (YAML mappings), arrays (sequences), strings, numbers, booleans and null. JSON uses braces, brackets and quoted keys; YAML uses indentation and readable lists.
JSON → YAML writes YAML 1.2 with two-space indentation, keeps the JSON key order and number spelling, and quotes strings that could otherwise look like numbers, booleans, dates or null. YAML → JSON reads one YAML 1.2 document and writes two-space-indented JSON.
Comments and YAML presentation are not data, so they do not survive the trip to JSON. Anchors, aliases and << merge keys are expanded into ordinary values.
- Turn a JSON configuration into YAML for a service, deployment manifest or documentation example.
- Read YAML configuration as JSON for an API payload, test fixture or program that expects JSON.
- Check that values such as "123", "true" and empty collections keep their types in both directions.
- Expand anchors, aliases and << merge keys into plain objects before using a configuration elsewhere.
Choose JSON → YAML or YAML → JSON, then paste one document or choose a sample. JSON must be strict, without comments or trailing commas; YAML must indent with spaces.
Convert and inspect the output. Quoted strings keep their type, multiline text keeps its line breaks and anchors are expanded.
Fix a reported error at its location. Invalid JSON, duplicate JSON or YAML keys, unsupported YAML types and YAML integers that would lose digits are rejected rather than converted lossily.
Copy the result or save converted.yaml or converted.json. Use result & reverse moves the output into the input and flips the direction, so you can check a round trip.
- JSON → YAML: {"code":"123","count":123} → code: "123" and count: 123; the types stay different.
- JSON → YAML: {"items":[],"settings":{},"value":null} → items: [], settings: {} and value: null.
- JSON → YAML: {"price":1.00,"id":9007199254740993} → price: 1.00 and id: 9007199254740993; numbers are not rewritten.
- JSON → YAML: {"users":[{"name":"Ada","roles":["admin"]}]} → a users list holding an object and its nested roles list.
- YAML → JSON: enabled: yes and active: true → {"enabled":"yes","active":true} under YAML 1.2 rules.
- YAML → JSON: message: | followed by indented lines → a JSON string with escaped \n line breaks.
- YAML → JSON: defaults: &d {port: 8080} and server: {<<: *d, host: localhost} → server holds both port and host.
- Conversion runs locally; YAML is parsed as data, and nothing is uploaded or executed.
- JSON → YAML writes YAML 1.2 with two-space indentation and a final newline. Repeated structures are written out in full, without generated anchors or aliases.
- YAML → JSON follows YAML 1.2 scalar rules: unquoted yes, no, on and off are strings. YAML 1.1 directives and multiple documents are not supported.
- Duplicate YAML keys and complex YAML mapping keys are rejected. A duplicate JSON key keeps its last value, as JSON.parse does, and the summary names the key and line. Scalar mapping keys become strings; quote keys when their spelling matters.
- JSON cannot represent custom tags, sets, explicit timestamps, binary tags, cyclic aliases, Infinity or NaN; these produce an error rather than a lossy result.
- JSON → YAML writes every number as spelled, including 1.00, 1e3 and integers beyond ±9,007,199,254,740,991, and keeps numeric-looking keys in their JSON order. YAML → JSON rejects unquoted integers outside that range and reads decimals with JavaScript number precision.
- Up to 100 nested levels and 1,000,000 values are supported, and alias expansion is bounded.