Developer

XML Formatter & Validator

Paste or load XML, then check well-formedness with the browser’s DOMParser, pretty-print with configurable indentation, or minify via XMLSerializer. Ideal for AndroidManifest snippets, RSS, SVG, and API payloads — everything stays on your device.

Ad placement — top banner

No file loaded

Drop an .xml file here or click to browse — contents are read only on your device
Output
Output appears here after Format, Minify, or Validate.
Ad placement — mid rectangle

What is XML?

XML (eXtensible Markup Language) is a tree-structured text format: one root element, nested child elements, attributes in quotes, character data and CDATA sections, plus comments and processing instructions. It powers Android resources and manifests, RSS/Atom, SVG, many SOAP and enterprise APIs, and countless config formats. Unlike JSON, XML carries namespaces, mixed content, and schema languages (XSD, Relax NG) — but this page only checks well-formed syntax, not schema validity.

What this tool does

DroidXP’s XML Formatter uses the browser’s DOMParser with the text/xml MIME type. If parsing fails, Chromium and WebKit expose a <parsererror> node with a human-readable message. On success, we walk the DOM to emit indented markup (elements, text, CDATA, and comments where preserved), or minify by serializing the root element with XMLSerializer. The original XML declaration is not round-tripped by the DOM; you can optionally prepend a standard declaration on formatted output.

  • Format: Pretty-print with 2 spaces, 4 spaces, or tabs.
  • Minify: Compact serialization of the parsed element tree.
  • Validate only: Confirm well-formedness without rewriting input text.
  • Privacy: Parsing runs locally — nothing is uploaded to DroidXP.

How to use this tool

  1. Step 1: Paste XML or drop an .xml / text file onto the zone.
  2. Step 2: Choose indentation and whether to add an XML declaration on output.
  3. Step 3: Click Format, Minify, or Validate only.
  4. Step 4: Copy the result into Android Studio, VS Code, or your ticket system.

Well-formed vs schema-valid

Well-formed means tags balance, attributes are quoted, and there is a single root — what DOMParser enforces. Schema validation (XSD, Schematron, Android lint rules) requires extra tooling. Use this formatter for quick syntax checks and readable diffs; use your build or IDE for contract validation.

Frequently Asked Questions

Does DroidXP upload my XML?

No. The document is parsed and formatted entirely in your browser tab. For confidential manifests or API keys embedded in files, follow your team’s policy before pasting into any website.

Why did my file fail with a parser error?

Common issues include unescaped < or & in text, mismatched end tags, duplicate attributes, invalid control characters, or multiple root elements. The browser’s error summary points to the problem class; fix the markup and try again.

Does formatting preserve comments and CDATA?

The parser keeps comments and CDATA nodes in the DOM; the pretty-printer writes them back in a normalized layout. Whitespace-only text nodes between tags are usually omitted from output for cleaner indentation.

What happened to my XML declaration?

After parsing, the DOM does not expose the original prolog as a node. Use the Prepend XML declaration option when you need <?xml version="1.0" encoding="UTF-8"?> on formatted output, or paste your own prolog back in your editor.

Is this suitable for huge documents?

Very large files can stress tab memory and the main thread. For multi‑megabyte logs or data dumps, prefer command-line tools (xmllint, xmlstarlet) or IDE features.

Does this validate AndroidManifest.xml against the SDK?

No. It only checks XML syntax. Element names, attributes, and values must still comply with Android packaging rules — use the Android Gradle Plugin, Lint, or DroidXP’s dedicated manifest validator for structural Android checks.

Will namespaces and prefixes look the same?

The DOM stores namespace URIs and prefixes; serialization may reorder attributes or normalize prefixes compared to hand-written files. Always review diffs before committing.