Format Converter
Convert between YAML, JSON, TOML and XML as you type — XML attributes become@_key properties. Nothing is uploaded.
How it works
Format Converter turns structured text between YAML, JSON, TOML and XML as you type. Pick the input and output format on each side, watch a running preview, swap directions with one click and copy the result. Parsed locally — files never leave your device.
Quick start
- Pick the input format and paste (or load a sample).
- Pick the output format; the result updates as you type.
- Swap or copy the output when it looks right.
Frequently asked questions
Is the conversion lossless?
Between YAML, JSON and TOML it is for typical configuration data. XML has no direct scalar types — values come back as strings or numbers depending on content, and attributes appear as @_key properties.
Why do XML attributes look like @_id?
Attributes are kept as properties with the @_ prefix so they never clash with child elements of the same name.
Why can some data fail to become TOML?
TOML cannot represent nulls, mixed-type arrays or top-level arrays. Those produce a readable error instead of broken output.
Is anything uploaded?
No. Parsing and building run entirely in your browser.
Choosing a config format: YAML vs JSON vs TOML vs XML
Four serialization languages, four philosophies — and the pitfalls each one carries. · 6 min read
What each format is optimized for
JSON is the interchange format of the web: strict, fast to parse, but noisy for humans — quotes everywhere, no comments, trailing commas forbidden. YAML trades some strictness for ergonomics: comments, indentation as structure, multi-line strings — which is why CI systems (GitHub Actions, Kubernetes) speak it. TOML was designed for configuration files specifically: unambiguous, flat sections in [brackets], minimal surprises. XML is the elder statesman: verbose but battle-tested, with attributes and namespaces that document-oriented systems still require.
The YAML foot-guns (a.k.a. the Norway problem)
YAML 1.1 parses the bare token 'no' as boolean false, version numbers like 1.10 as floats, and leading zeros as octal — so country code 'NO' (Norway) becomes false, and 'version: 1.10' silently becomes 1.1. Quote everything that is really a string. Indentation is structural, so a tab instead of two spaces breaks the file in ways the error messages only hint at. Converting YAML to JSON first — like this tool does when you pick JSON output — is a quick way to see what the parser actually understood.
TOML and XML: the corners
TOML has no top-level array and no null; mixed-type arrays fail to serialize. If your data model genuinely needs those, TOML is the wrong target — pick JSON or YAML. XML round-trips have their own rule: attributes come back as @_prefixed properties because attributes and child elements can share a name, and the prefix keeps them from colliding. Values in XML are text; a converter guesses numbers where they look numeric, so treat any type-sensitive output with a quick re-read.
One universal tip: after any format conversion, spot-check one nested list and one nested table. Those are the two structures every serializer handles slightly differently, and they are where silent coercion happens.