XML formatter validates and indents XML, or converts between XML and JSON in your browser.
Conversion uses @ for attributes. XML and JSON have different data models; ordering, comments, namespaces and types may not round-trip.
How to use
- Paste XML or JSON and choose the matching operation.
- Generate to validate and format or convert the input.
- Read any syntax location, review the mapping and copy or download.
Frequently asked questions
Are errors located by line?
XML validation reports the available row and column. Invalid input is rejected before formatting.
Is XML to JSON lossless?
No. Attributes use @ keys; mixed text order, comments, namespaces and inferred types can change.
Are external entities loaded?
No. DTD and entity declarations are rejected; the tool does not fetch referenced documents.
What JSON root should I use?
Use one top-level XML element. Arrays are wrapped by the shared converter; invalid element names or multiple roots are rejected.
Whitespace and mixed content
Pretty-printing adds layout whitespace. Check prose with inline tags before replacing the source.
One mapping across tools
The JSON conversion reuses the existing XML converter helpers. This page adds paste editing, validation and formatting.
