XML-Formatierer und -Minimierer
Schön formatieren oder XML minimieren, mit Validierung und konfigurierbarer Einrückbreite.
Kurze Antwort: XML-Formatierer und -Minimierer: XML übersichtlich formatieren oder minimieren, inklusive Validierung und einstellbarer Einzugsbreite. Läuft vollständig im Browser, kostenlos, keine Registrierung erforderlich.
Zuletzt aktualisiert
Gut zu wissen
Because this formatter uses the browser's own DOMParser, it validates well-formedness — balanced tags, quoted attributes, legal characters — the same way your app's XML parser will. That makes it a fast sanity check before you ship a config, a sitemap, or a SOAP request: if it won't format, it won't parse in production either.
It does not validate against a schema, though. An XSD or DTD defines which elements are allowed where and what types their values must be; checking that requires a much heavier validator. So a document can format perfectly here yet still be rejected by a strict service that enforces a schema. Use this for structure and readability, and a dedicated schema validator for contract compliance.
The minify mode strips the whitespace between tags, which is exactly what you want for RSS feeds, SVG assets, or SOAP payloads where every byte counts on the wire. Be careful with elements whose whitespace is significant — <pre>-style content or anything marked xml:space="preserve" — since DOMParser normalizes text-node whitespace per the spec. Wrap literal content in CDATA when you need it kept verbatim.
Namespaces, the XML declaration, and CDATA sections are preserved, so SVG and SOAP round-trip safely. If you actually need to move the data into JSON or YAML rather than just pretty-print it, reach for the JSON ↔ XML converter instead.
Häufig gestellte Fragen
- Wird es gegen ein XML-Schema (XSD) validieren?
- Nein — nur die Wohlgeformtheit (korrekte Tags, ausgeglichene Anführungszeichen, gültige Zeichen). Die XSD-Validierung benötigt eine viel größere Bibliothek; verwenden Sie dafür ein Desktop-Tool.
- Ist das sicher für SOAP / RSS / SVG?
- Ja — alle drei sind gültiges XML. Der Formatter bewahrt Namensräume, CDATA-Abschnitte und die XML-Deklaration.
- Wird mein XML hochgeladen?
- Nein — DOMParser läuft im Browser. Nichts verlässt Ihr Gerät.
- Warum wird die Ausgabe manchmal anders gewickelt als erwartet?
- DOMParser normalisiert Whitespace innerhalb von Textknoten gemäß der XML-Spezifikation. Verwenden Sie einen CDATA-Abschnitt oder ändern Sie <code>xml:space="preserve"</code>, wenn Sie genaue Whitespace-Präzision benötigen.
- Kann ich eine große XML-Datei minimieren?
- Ja — Dateien von bis zu mehreren Megabyte werden sofort minimiert. Größere Dateien (50 MB+) können an die Speichergrenzen des Browsers stoßen.