XML Tools — Format, Validate & Minify

Format, validate and minify XML in one place. Each tool runs entirely in your browser, shares the same parser and reports problems with exact line and column numbers — no upload, no account.

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

TL;DR: Three free XML tools share one parser: a formatter, a validator and a minifier. All work happens inside the browser tab — 0 uploads, 0 accounts and 0 server-side parsing. The hub links to one guide per job.

Pick the job before the tool. Re-indenting, checking well-formedness and removing whitespace are 3 different operations with different failure modes, so each has its own topic guide: XML Formatter, XML Validator and XML Minifier. This page keeps the most common first step — formatting — usable immediately above.

The tools load 2 local JavaScript files and 1 stylesheet; during any format, validate or minify action the Network panel records 0 new requests. Input is capped at 2,097,152 bytes (2 MiB), nesting at 2,000 levels and documents at 150,000 elements, because the parser runs on the tab’s main thread.

Three tools, one parser: the numbers that matter

  • XML input cap — 2,097,152 bytes (2 MiB) — 1 byte more is refused before tokenising
  • Nesting cap — 2,000 levels — deeper documents stop with an error, not a crash
  • Element cap — 150,000 elements — protects the tab from pathological trees
  • Indent widths — 3 options — 2 spaces, 4 spaces or 1 tab
  • Predefined XML entities — 5 names — amp, lt, gt, quot and apos
  • Whitespace code points — 4 values — U+0020, U+0009, U+000A, U+000D
  • Numeric entity syntaxes — 2 forms — decimal   and hexadecimal  
  • XML declaration versions — 2 values — 1.0 and 1.1
  • Errors shown per run — 5 of 12 — the report caps at 5 visible, 12 internal entries
  • Formatter record — 66 B → 84 B — 6 lines; 4 elements, 1 attribute, max depth 3
  • Validator record — 55 B, 1 error — reported at Line 1, Column 47
  • Minifier record — 465 B → 415 B — 11% smaller; comments preserved
  • Engine test assertions — 48 checks — including 300 random malformed inputs
  • Client files — 2 JS + 1 CSS — 0 third-party requests, 0 cookies
  • Site size — 7 pages, 2 languages — 3 tool guides, 1 hub, 2 trust pages
  • OG card — 1,200 × 630 pixels — one image asset, referenced by all 7 pages

Measured on 9 November 2026: the 465 B catalog fixture contains 10 elements, 6 attributes, 7 text nodes, 1 processing instruction and 3 nesting levels. Formatting a separate 66 B one-line order document adds 18 bytes of indentation across 6 lines (84 B output), and the minifier returns it to exactly 66 B. The engine refuses 2.06 MB of synthetic XML in about 1 ms, formats 531 KB of nested rows in 106 ms, and survives 300 random malformed inputs with 0 exceptions across 48 assertions. Column numbers are 1-based; a tab counts as 1 character; a BOM at byte 0 is 1 code point that gets stripped; the 4 whitespace code points are U+0020, U+0009, U+000A and U+000D.

Sitemap and page inventory: 7 URLs (4 tool pages, 2 trust pages, 1 German guide); 3 action buttons per tool page with 1 primary; the byte counter updates at 1-byte granularity starting from 0 B; the editor holds 1 input pane and 1 read-only output pane.

Every page shares 1 navigation bar, 1 footer and 2 local scripts; the tool card exposes 3 actions and an indentation menu with 3 options.

The primary action is Format XML on 5 of the 7 pages; the validator and minifier each lead with their own verb.

The sitemap lists those 7 URLs; robots.txt allows crawling and blocks only the 2 development folders.

Which XML tool should I use?

A quick decision table for the three jobs.
What you needUse this toolWhat you get
Make a minified or hand-edited XML file readable againXML FormatterConsistent indentation, normalised attribute spacing and a syntax check in one pass
Find out why a file will not parseXML ValidatorLine and column location, plain-English message, fix hint and a caret code frame
Shrink XML before packaging or sending itXML MinifierCompact output plus the exact bytes and percentage saved
Format XML on a machine where you cannot install anythingXML FormatterThe formatter runs entirely in the browser — no install, no admin rights, no upload
Validate against an XSD or DTD schemaA schema-aware validator (for example xmllint --schema)This site checks well-formedness only; schema validation needs the schema document

How to use the tools

  1. Paste your XML

    The editor sits at the top of this page and of each topic guide. The pane header shows the exact input size in bytes and turns red at the 2,097,152-byte cap.

  2. Pick the action

    Format, minify or validate: 3 buttons, 1 primary action per page. The hub keeps Format XML primary because re-indenting is the most common first step.

  3. Read the result or the errors

    Valid XML appears in the right pane, ready to copy in 1 click. Invalid XML is left untouched and returns up to 5 errors with line, column and fix hint.

  4. Copy and move on

    Copy result puts the output on the clipboard; Clear resets both panes; Load sample fills a 465 B catalog document with 10 elements and 6 attributes.

What all three tools have in common

  • One parser, one error format. More than 20 error classes produce the same 4 fields: line, column, plain-English message and fix hint.
  • Content-preserving. The formatter changes 0 characters inside text nodes, comments, CDATA blocks and entity references; only indentation and inter-attribute spacing change.
  • Private by design. 0 cookies, 0 analytics calls and 0 upload endpoints; the Network panel stays empty during any action.
  • No dependencies. 2 local JavaScript files, 1 stylesheet, 0 CDN requests and 0 external fonts.

How this site is organised

The site has 7 pages in 2 languages: 1 hub, 3 topic guides, 2 trust pages and 1 German formatter guide. The topic guides cross-link each other; the German page is paired with the English formatter guide through 3 hreflang annotations (de, en, x-default).

Frequently asked questions

Which XML tool should I start with?

Start with the XML Formatter when you want readable, consistently indented output. If the file will not parse at all, go straight to the XML Validator, which reports the line and column of every error. If you need a smaller file, use the XML Minifier. All three share the same parser, so the error messages are the same everywhere.

Are these XML tools free?

Yes. Every tool on this site is free, has no account requirement, no usage limit and no paid tier. There is no advertising inside the editors and no upload.

Is my XML uploaded to a server?

No. Formatting, validating and minifying are implemented in plain JavaScript that runs in your browser. You can open the browser's developer tools, switch to the Network tab and run any action: no request carries your document.

Do the tools work on mobile?

Yes. The editor and result panes stack on narrow screens and all processing happens on the device. Mobile keyboards make very long documents awkward, so phones are best for short responses or configuration blocks.

Can I use the tools offline?

Once the page and its local assets have loaded, all three tools keep working without a network connection, because using them makes no requests.

Do the tools validate XML against an XSD or DTD schema?

No. They check well-formedness: tag nesting, attribute quoting, entity references and a single root element. Schema validation needs the schema document and a schema-aware validator such as xmllint --schema.