About XML Formatter

A small, single-purpose site: free browser tools for formatting, checking and minifying XML. No accounts, no uploads, no tracking scripts.

By the XML Formatter team · Updated · About this siteEverything runs in your browser — no uploads, no cookies, no tracking.

0 B
Result—

Runs 100% in your browser · 2 MB limit · Ctrl/⌘ + Enter to run

XML Formatter is a small, single-purpose website: free browser tools for formatting, checking and minifying XML. There are no accounts, no uploads and no tracking scripts. The site exists because the alternatives are usually either heavyweight desktop tools or online formatters that quietly post your document to a server.

The tools are meant to do three jobs well — pretty-print XML, tell you exactly why a document is malformed, and strip whitespace when you need a smaller file — and to leave everything else alone. No XML-to-JSON conversion, no schema designer, no sign-up funnel. One tool per page, one primary action per page.

How the tools work

Formatting, validation and minification all run on a custom XML tokenizer and parser written for this site. It is plain JavaScript, delivered as a local file with the page; there is no framework, no CDN, no third-party library and no server component. That choice has a cost — the parser is maintained here rather than imported — and a benefit: every error message is consistent across browsers and always includes a line and a column, which off-the-shelf browser parsers do not guarantee.

The formatter is content-preserving. Element names, attribute values, text content, comments, CDATA sections, processing instructions and entity references are copied exactly; only indentation and the spacing between attributes are normalised. Elements that mix text and child elements stay inline so that no whitespace is invented inside text. Running the formatter twice produces byte-identical output.

How the tools are tested

Every release is checked by an automated harness before it ships. The suite verifies that well-formed documents format correctly and stay idempotent, that mixed content such as <p>Hello <b>world</b>!</p> is preserved exactly, that formatting, minifying and re-formatting return to the same output, and that comments, CDATA sections, DOCTYPE declarations and entity references survive a round trip.

The error-reporting tests use deliberately broken documents — a mismatched closing tag, an unquoted attribute value and an unescaped ampersand among them — and assert the exact line and column of each reported error. The harness also feeds 300 randomly generated malformed inputs to the parser to confirm it never throws, checks that nesting beyond 2,000 levels and input above 2 MB are refused cleanly, and measures formatting time on a half-megabyte document to catch performance regressions. The same engine runs in the browser, so these tests exercise the code you actually use.

Editorial and correction policy

The written guidance on this site aims to be accurate and specific: what the parser does, what it refuses to do, and which problems it cannot solve. Where a limitation exists — no schema validation, no namespace resolution, a 2 MB cap — it is stated on the page rather than left for you to discover at the moment you need it.

If you find a factual error, an error message that is confusing, or a case where the formatter changes a document it should not, please email us with the browser you used and the smallest sample that reproduces the issue. Corrections that change a page are reflected in its visible “last updated” date. This site has no affiliate links, no sponsored content and no advertising inside the tools.

Who maintains this site

XML Formatter is maintained by a small independent team of web developers who work with XML configuration, integration payloads and build systems day to day. The site is self-funded and free; it does not take investment, run ads in the editors or plan to introduce accounts. The tools are deliberately narrow because narrow tools are easier to keep correct.

Contact: hello@xmlformatter-9gs.pages.dev. We read every message and usually reply within a few working days.

Frequently asked questions

Who runs XML Formatter?

An independent team of web developers who work with XML configuration, integration payloads and build systems. The site is self-funded and free; it has no accounts, no advertising inside the tools and no investment.

Can I report a bug or suggest a feature?

Yes — email hello@xmlformatter-9gs.pages.dev with the browser you used and the smallest sample that reproduces the problem. Please do not send sensitive XML; a minimal sample is enough.

Do you accept advertising or paid placements?

No. The site loads no advertising, affiliate or sponsored scripts, and the tools contain no placements. Pages are written to be useful, not to sell anything.

How often is the site updated?

When the parser changes or a meaningful correction is made. Every page shows a visible last-updated date, and corrections that change guidance are reflected there.

Related XML tools