JSON-naar-YAML-converter
Converteer tussen JSON en YAML in beide richtingen met één klik.
Snel antwoord: JSON ↔ YAML-converter: zet JSON en YAML met één klik in beide richtingen om. Werkt volledig in je browser, gratis en zonder registratie.
Laatst bijgewerkt
Goed om te weten
YAML is essentially a superset of JSON, so JSON → YAML always succeeds and is the direction most people want — turning a terse API payload into the readable, comment-friendly form that Kubernetes manifests, GitHub Actions workflows, and Docker Compose files use. The reverse, YAML → JSON, works for any YAML whose features JSON can represent.
Two YAML features have no JSON equivalent, so expect them to change. Comments are dropped entirely, because JSON has no comment syntax — keep a commented source of truth if the annotations matter. Anchors and aliases (&name / *name), which let YAML reference a block in multiple places, are expanded inline on conversion; the result is logically identical but has the shared block duplicated wherever it was referenced.
Number precision is a shared trap: both formats store numbers as IEEE-754 doubles, so integers above 2^53 (about 9 quadrillion) — think Twitter/Snowflake IDs — silently lose precision. If your data has huge integers, keep them as quoted strings in the source so they survive the round trip untouched.
Don't be alarmed if the YAML output looks reorganized: the emitter normalizes quoting and block style, adding quotes only where the spec requires them. The structure is unchanged even when the bytes differ. To simply tidy an existing YAML file without converting it, use the YAML formatter.
Veelgestelde vragen
- Surviven mijn opmerkingen YAML → JSON?
- Nee — JSON heeft geen syntaxis voor opmerkingen. Opmerkingen worden stilletjes verwijderd.
- Wat met ankers en aliassen?
- We breiden ze uit bij conversie naar JSON, aangezien JSON geen verwijzingen kan uitdrukken. Het resultaat heeft wat duplicatie maar dezelfde logische structuur.
- Hoe gaat de converter om met grote getallen?
- Beide formaten gebruiken IEEE-754 doubles, dus waarden boven 2^53 verliezen precisie. Als je exacte grote gehele getallen nodig hebt, houd ze dan als strings in je brondgegevens.
- Worden mijn bestanden geüpload?
- Nee — beide richtingen draaien volledig in je browser.
- Waarom is mijn YAML-output soms heel anders dan de invoer?
- We normaliseren — strings alleen citeren waar nodig, de canoniek blokstijl kiezen, in sommige gevallen alfabetisch ordenen. De structuur is identiek, zelfs als de bytes dat niet zijn.