Data Format Converter
Convert between JSON, YAML, TOML, XML, and CSV. Auto-detect input format, pretty-print toggle, and inline error messages. Runs entirely in your browser.
About this tool
Data Format Converter translates between the five everyday configuration and data-interchange formats: JSON, YAML, TOML, XML, and CSV. Paste any of them and the tool auto-detects the input format, parses it, and re-emits it in the target format with proper escaping and pretty-printing. Parse errors are shown inline with line and column so you know exactly what to fix.
Each format has its own quirks. JSON is the lowest common denominator — strings, numbers, booleans, arrays, objects. YAML adds comments, multi-line strings, and references. TOML is JSON with a config-file-friendly surface syntax (sections, comments, dates). XML adds attributes and namespaces that do not translate cleanly to the others. CSV is tabular and only round-trips to and from the "array of flat objects" shape of the source. The tool flags lossy conversions before applying them.
When to use this tool
- Migrating config files. A Helm chart in YAML to be consumed by a Terraform module that wants JSON — paste and convert.
- Quick CSV inspection. Paste a spreadsheet export, get a clean JSON array to feed into your test suite.
- YAML / TOML interop. Same configuration values, different surface syntax preferences across team members.
- Debugging XML APIs. Convert the SOAP response to JSON to read it without drowning in angle brackets.
About lossy conversions
JSON → YAML and back is lossless for plain data. XML → JSON loses the distinction between attributes and child elements (we map attributes to a@attr key, which is a convention not a standard). CSV → JSON requires the first row to be headers (toggle this) and assumes flat records — nested objects are not representable. The tool warns when the round-trip would not be byte-identical so you can choose to accept or pick a different target.
Frequently asked questions
Why does my YAML fail to parse?
key:value vs key: value); missing quotes around values that contain : or #; tabs mixed with spaces. The parse error message includes the line and column so you can find the offending character quickly.
Can I convert XML with attributes?
@ when converting to JSON / YAML / TOML. <item id="1">text</item> becomes { "item": { "@id": "1", "#text": "text" } }. This is a convention (used by Badgerfish, JsonML variants) — not a single standard. Converting back to XML rebuilds the original structure. Mixed content (text and elements interleaved) is the lossy case; we flag it.