JSON ↔ XML Konverter
Konvertieren Sie zwischen JSON und XML — runden Sie für geschachtelte Objekte, Arrays und Primitive.
Kurze Antwort: JSON ↔ XML Konverter: JSON und XML ineinander umwandeln – für verschachtelte Objekte, Arrays und primitive Werte mit verlustfreier Rückkonvertierung. Läuft vollständig im Browser, kostenlos, ohne Anmeldung.
Zuletzt aktualisiert
Gut zu wissen
JSON and XML model data differently, so the conversion is a best-effort mapping rather than a perfect round trip. JSON has arrays, objects, and typed primitives; XML has elements, attributes, ordered children, and mixed content. This tool maps object keys to element names and repeated elements to arrays, which covers the common case of hierarchical, element-only documents cleanly.
The biggest limitation to plan around is attributes. Attribute-heavy formats like SVG, XAML, or many configuration schemas store meaning in <tag attr="x">, and that information is not modeled here — so those conversions are lossy. Likewise, an element that happens to appear only once becomes a JSON object rather than a single-element array, which can surprise code that always expects a list. If your XML contract requires an array, wrap repeated elements in a parent container.
Because XML type information is weak (everything is text unless a schema says otherwise), a number like 42 may come back as the string "42" after a round trip. Coerce types explicitly in your consuming code rather than assuming they survived.
If your goal is simply to tidy up an XML document rather than convert it, the XML formatter preserves attributes, namespaces, and CDATA that this converter drops. For JSON-to-config workflows, the JSON ↔ YAML converter is often a better fit than XML.
Häufig gestellte Fragen
- Warum werden Arrays manchmal falsch erkannt bei XML → JSON?
- Ein XML-Element, das genau einmal erscheint, wird zu einem Objekt, nicht zu einem Array mit einem einzelnen Element. Wenn Sie immer ein Array benötigen, verarbeiten Sie das Ergebnis nach oder wickeln Sie wiederholte Elemente in einen übergeordneten Container.
- Was ist mit XML-Attributen?
- Wir modellieren derzeit keine Attribute — nur den Inhalt von Elementen und untergeordneten Elementen. Für attributlastiges XML (SVG, XAML) ist die Konvertierung verlustbehaftet.
- Wird gemischter Inhalt (Text + Elemente) überleben?
- Teilweise — Text wird erhalten, aber die Reihenfolge von gemischtem Text/Elementen kann sich ändern. JSON hat kein natives Modell für gemischten Inhalt.
- Werden Namensräume beibehalten?
- Elementnamen behalten ihr Namensraum-Präfix (z. B. <code>soap:Envelope</code>), aber Namensraumdeklarationen gehen auf der JSON-Seite verloren.
- Werden meine Dateien hochgeladen?
- Nein — beide Richtungen laufen vollständig in Ihrem Browser.