Pretty-print XML with configurable spacing and explore structure in an interactive tree or D3 graph. Export as SVG or PNG. Ideal for SOAP, Maven, RSS. Browser-based.
The XML Formatter is a browser-based tool that instantly pretty-prints XML documents with configurable indentation using js-beautify's HTML/XML formatter. Beyond formatting, it provides an interactive Tree View to collapse and expand XML elements by depth, and a card-based Graph View that renders element relationships as a hierarchical node graph — both exportable as SVG or PNG. The formatter handles XML 1.0/1.1, CDATA sections, processing instructions, and well-formedness checking. All processing runs in a Web Worker; your documents never leave the browser.
QDoes the formatter validate XML well-formedness?
Yes — js-beautify parses the XML before formatting and surfaces well-formedness errors with clear messages. Note that it does not perform DTD or XSD schema validation.
QWhat is the Tree View?
The Tree tab renders your formatted XML as a collapsible, expandable element tree — ideal for navigating deeply nested XML without scrolling through raw text.
QWhat is the Graph View and how do I export it?
The Graph tab renders element relationships as an interactive card-based hierarchical node graph. Use the SVG button for a lossless vector export, or PNG for a high-resolution raster image.
QIs my XML sent to a server?
No. All formatting, tree parsing, and graph rendering happens locally inside your browser. Nothing is transmitted to any server.