What this tool does
Convert JSON to YAML — and YAML back to JSON — without leaving your browser. The conversion is fully round-trippable (types and structure are preserved), so you can paste a YAML config and get strict, copy-pastable JSON, or pretty a JSON payload into something a human can read in a pull-request diff.
How to use it
Paste JSON (or load the example), pick an indent (2 or 4 spaces), and read the YAML on the right. Toggle YAML → JSON instead to reverse the direction.
Input: {"service":"devsmiths","version":2,"endpoints":[{"path":"/json/formatter","method":"GET"},{"path":"/json/repair","method":"POST"}],"public":true}
Output (YAML):
service: devsmiths
version: 2
endpoints:
- path: /json/formatter
method: GET
- path: /json/repair
method: POST
public: trueLimits and edge cases
- YAML conversion is round-trippable, but YAML supports concepts (anchors, references, tags) that JSON doesn’t. Going YAML → JSON resolves anchors and drops tags.
- For invalid JSON input, run the JSON Repair tool first; the converter only accepts strict RFC 8259 JSON.
- Numbers beyond ±2^53 lose precision in any JavaScript-based parser — both directions.
- Background reading: JSON vs YAML vs XML covers when each format is the right pick.
Frequently asked questions
- Is my data sent to a server?
- No. Every conversion runs in your browser — the page never uploads your JSON or its output.
- Can I go YAML → JSON as well?
- Yes — open /json/convert/yaml and toggle the 'YAML → JSON instead' option. CSV and XML are one-way for now (JSON → CSV / JSON → XML); the architecture supports reverse modes and they're on the roadmap.
- How are nested objects handled in CSV?
- By default nested keys are flattened with dots (e.g. user.address.city). Switch to bracket notation (user[address][city]) or 'stringify' to keep the nested value as a JSON-encoded cell. Arrays are JSON-stringified into a single cell — CSV's flat row-and-column model can't faithfully represent arbitrary nesting.
- Does the XML output follow a schema?
- No, it's a direct, conventional mapping: each object key becomes an element, arrays repeat the parent element, and primitive values become escaped text content. There's no attribute-vs-element heuristic — everything is an element. If you need attribute-style XML, a roadmap option is on the way.
- Why does the CSV exporter complain about my input?
- CSV needs an array (or single object). A bare string/number/boolean as the root has no row-and-column structure. Wrap it in an array of objects, or use the YAML / XML variant which handles arbitrary JSON.
- Can the converter handle TSV, MessagePack, or TOML?
- Not yet. The dispatch layer supports new targets — they're on the roadmap. Open an issue if you have a use-case.