#1 India's Top IT Training Institute

×

About Uncodemy

Know more about who we are and what we stand for.

About Us

About Us

Discover our mission to equip individuals with essential IT skills and industry expertise.

Read More →
UnCodeMy Gallery

UnCodeMy Gallery

Explore highlights from our IT training sessions and success stories.

Read More →
×

Free Resources

Learn, practice and plan your career — bilkul free.

Tutorials

Tutorials

Step-by-step written tutorials to learn any technology at your own pace.

Read More →
Free Counselling

Free Counselling

Book a free video counselling session and pick the right course for you.

Read More →
Online Compiler

Online Compiler

Write, run and test your code online — no setup required.

Read More →
⚡ FREE · VALIDATES TOO

XML Formatter: Beautify, Minify and Check XML

Paste XML to pretty-print it with your indent, or squeeze it into one line.

  • 🧹 Pretty print
  • 📦 Minify
  • ✅ Well-formed check

How to use the XML Formatter

  1. 1. Paste XMLSOAP responses, sitemaps, Android layouts, RSS or config files.
  2. 2. Choose outputPretty print with 2 spaces, 4 spaces or tabs, or minify.
  3. 3. Copy or downloadGet the formatted XML or the exact parser error.

Formatting and checking

XML from APIs and logs often arrives as one long line, which is impossible to read. The formatter puts each element on its own line with indentation that shows nesting. Short elements that only hold text, like <title>Python Basics</title>, stay on one line so the result is compact. Empty elements are written self-closing, like <course id="sql201"/>. Comments, CDATA sections, processing instructions and the <?xml …?> declaration are kept.

Before formatting, the XML is parsed by your browser's strict XML parser. If it is not well-formed, for example a tag is not closed or an & is not escaped, you get the parser's error message instead.

Worked example

The sample is a one-line course catalogue with 8 elements: catalog, two course elements, title, fee, topics and two topic elements. Pretty-printed with 2 spaces, it becomes:

<catalog>
  <course id="py101" level="beginner">
    <title>Python Basics</title>
    <fee currency="INR">15000</fee>
    …

Minify does the reverse: it removes the whitespace between tags to make the smallest file for sending over a network. Note that whitespace inside text is kept, because in XML it can be meaningful. If the parser reports an error, the message usually names the line and column, so fix that spot and format again. Large files of several megabytes still format quickly, because the work happens on your own device.

Frequently asked questions

What does well-formed mean?

Every tag closes, tags nest properly, there is one root element, attribute values are quoted and special characters are escaped.

Does it validate against an XSD?

No. It checks that the XML is well-formed, not that it follows a particular schema.

Will it change my data?

Only whitespace between tags changes. Element names, attributes and text stay the same.

Is the xml formatter free?

Yes, it is free. Formatting your first XML asks for your name and WhatsApp number once, and after that the xml formatter and every other Uncodemy tool open without the form.

More free tools

See all free tools