XML Beautifier: Format, Minify and Inspect XML Online
XML Beautifier formats XML with its own parser running entirely in your browser. It keeps what usually gets lost — the XML declaration, the DOCTYPE and its internal subset, namespaces, comments, processing instructions, CDATA, attribute order and quote style — and never fetches external DTDs or expands entity references. Every well-formedness error comes with a line, a column and a code frame, and the output pane adds a collapsible tree, a line diff against your input, document statistics and warnings.
XML Beautifier is an online XML formatter built for documents that have to survive formatting unchanged. It parses the input with a dedicated XML parser that runs in your browser, then re-serializes it indented or minified. The XML declaration, DOCTYPE and its internal subset, namespaces, comments, processing instructions and CDATA sections are preserved, attribute order and quote style are kept by default, and text inside elements — including mixed content such as <p>Hello <b>world</b>!</p> — is never reflowed or trimmed. The xml:space attribute is honoured.
Entity and character references are passed through verbatim. The tool does not fetch external DTDs, does not resolve external entities, and does not expand the entities declared in an internal subset; what you wrote comes back the way you wrote it. That makes the output safe to feed to a parser or a build system, and it means the formatted file is equivalent to the input rather than a lossy rewrite of it.
When a document is not well formed, the error reports the line, the column and the surrounding text, and the interface can jump straight to that position. A "Fix common problems" action repairs the mistakes people usually make when hand-editing XML — a bare ampersand, unquoted attributes, unclosed tags, junk before the declaration — and shows every change as a diff before anything is applied.
The output pane has four views. Code shows highlighted, line-numbered output. Tree shows the parsed structure and links each node back to its source line. Diff compares the output with your input. Info & Issues reports element, attribute, text, comment and CDATA counts, byte and gzip sizes, declared namespaces and undefined prefixes, duplicate IDs, mixed content and other warnings. An XPath bar evaluates expressions against the document, and the presets cover config files, diff-friendly output, a safe mode that never alters whitespace, and minification.
XML Beautifier runs entirely in your browser. Your document is not uploaded, stored or sent to a server, and the tool works offline once the page has loaded.
Step 1: Paste, drop or load an XML file. The encoding is detected from the byte-order mark or the XML declaration, so UTF-16 and legacy encodings open correctly.
Step 2: Pick a preset or adjust the options: indentation, attribute order and wrapping, empty-element style, quote style, XML declaration, CDATA, blank lines and line endings.
Step 3: Check the result in the Code, Tree, Diff or Info & Issues tab. If the document does not parse, the error banner reports the exact line and column and can jump to it.
Step 4: Copy or download the output, or send it through the sibling XML tools. Large documents are formatted in a background worker so the page stays responsive.
Use case: Re-indent a dense, machine-generated XML file before reviewing or committing it, so its structure is easy to scan.
Use case: Check that an XML document you did not write is well formed, and see the exact line and column of the first problem.
Use case: Prepare XML for a readable diff: sort the attributes, put one per line, and leave the text content untouched.
Use case: Inspect an unfamiliar document with the tree view, document statistics and an XPath bar instead of scrolling through raw markup.
Use case: Format configuration files such as Maven pom.xml, Android layouts or .config files, where long attribute lists are the norm.
Use case: Minify XML for size while keeping mixed content and entity references exactly as they were.
Use case: Convert a whole folder of XML files in one go and download the formatted results as a zip.
Use case: See the closest xmllint command and .editorconfig for the options you chose, so the same style can be applied in your editor or CI.