YAML / JSON / TOML / XML Converter
Convert configuration data between YAML, JSON, TOML and XML in any direction. For untangling Kubernetes manifests, docker-compose files, CI pipelines and Rust or Python project configs without hand-translating syntax.
How to use
- Paste your document into the input panel.
- Select the source format and the target format.
- Convert, review the output for type surprises, and copy it out.
These four formats encode the same tree of maps, lists and scalars with wildly different trade-offs. JSON is the strict, universal interchange format. YAML is a superset of JSON optimised for human editing, indentation instead of braces, comments allowed, and dominates Kubernetes, Ansible, docker-compose and GitHub Actions. TOML deliberately stays flat and unambiguous, which won it Cargo and Python's pyproject.toml. XML predates them all and persists in Maven, Android resources and SOAP-era enterprise APIs.
Conversion is mostly mechanical, but the type systems don't line up perfectly, and that's where the famous gotchas live. YAML 1.1 interprets unquoted no, off and yes as booleans, the 'Norway problem', where a country code NO becomes false. Unquoted version numbers like 3.10 parse as the float 3.1, and octal-looking strings like 0777 can become 511. Converting to JSON makes these misparses visible instantly, which is arguably the best debugging trick for YAML configs. In the other direction, JSON to YAML always succeeds since YAML is a superset, but comments obviously can't be conjured back.
TOML and XML add their own wrinkles: TOML has no null, so null values must be dropped or represented conventionally. XML has no native distinction between a single child and a list of one, so round-trips need conventions for arrays and attributes. This converter preserves types where the target format can express them and flags where it cannot. Documents are converted server-side and never retained for anonymous users.
Examples
Input: name: velona
replicas: 3
features:
- tools
- gateway
Output: {"name": "velona", "replicas": 3, "features": ["tools", "gateway"]}
Input: country: NO
Output: {"country": false}, quote it (country: "NO") to keep the string
Input: {"package": {"name": "demo", "version": "1.2.0"}}
Output: [package]
name = "demo"
version = "1.2.0"
Frequently asked questions
Why did my YAML value turn into true/false or a number?
YAML auto-types unquoted scalars: yes/no/on/off become booleans (in YAML 1.1), 3.10 becomes the float 3.1, and ~ becomes null. Quote any value that must stay a string, country codes, version numbers, phone numbers.
Will I lose my comments converting YAML to JSON and back?
Yes. JSON has no comment syntax, so comments are dropped in conversion and cannot be restored on the way back. Keep the YAML file as the source of truth and generate JSON from it, not the reverse.
Does indentation matter when I paste YAML?
Completely, indentation is YAML's structure, and tabs are forbidden (spaces only). Most 'mapping values are not allowed here' errors are one line indented with a tab or misaligned by a space.
How are XML attributes handled in conversion?
There's no universal rule, so this converter uses the common convention of prefixing attribute names (e.g. @id) to distinguish them from child elements. Expect to adjust conventions if your target parser differs.
Related tools
Velona is India's INR-native AI API gateway with 300+ models, UPI top-up from ₹10, no foreign card needed. These tools are free forever.