XML फ़ॉर्मैटर
XML formatter
Make an XML file readable with clean indentation, check it's well formed, or minify it.
Runs in your browser · nothing uploaded
Paste XML to format and validate it.
How to use it
- 01Paste your XML.
- 02Choose Format (with indent size) or Minify.
- 03Fix any reported error, then copy or download.
<note><to>Ram</to><body>Hi</body></note>
<note> <to>Ram</to> <body>Hi</body> </note>
About this tool
Each element goes on its own line, indented by depth, and short text-only elements like <to>Ram</to> stay on one line. Comments, CDATA sections, processing instructions and attributes are kept exactly as written.
Before formatting, the XML is checked twice: for tag balance (with the line of the first mismatched or unclosed tag) and by your browser's own XML parser, which also catches bad entities and attribute syntax. Minify removes whitespace between tags but leaves text content alone. It's handy for sitemaps, RSS feeds, SOAP messages, Android layouts and e-invoice files.
Everything runs in your browser. Your text is never uploaded or stored, so it is safe for drafts, code and private documents.
हिंदी में मदद
XML को सही इंडेंटेशन के साथ पढ़ने लायक़ बनाएँ, जाँचें कि वह सही है या नहीं, या उसे छोटा (minify) करें। गलत या खुले टैग की लाइन बताई जाती है।
Questions
Does it validate against a schema (XSD)?
No. It checks that the XML is well formed (every tag closed and properly nested, one root element), not that it follows a particular schema.
Will formatting change my data?
Element text is trimmed of surrounding whitespace when pretty-printing. If whitespace inside elements matters (as in some mixed content), use Minify, which only removes whitespace between tags.
Is the XML uploaded?
No. Parsing and formatting happen in your browser, and external entities or DTDs are never fetched.