What is an XML file?

XML is a plain text format that wraps data in named tags, like <book><title>...</title></book>. Sitemaps, RSS feeds, office files, maps and many business systems use it. It is strict: every tag must be closed and the tags must nest correctly.

Drop your file here

or select file

Images, video, audio, documents, data, archives, fonts and more.

About XML file:

01XML at a glance

Full name
Extensible Markup Language
Type
Plain text with tags, for structured data
Extension
.xml (and many specific ones: .rss, .kml, .gpx, .xsd)
MIME type
application/xml or text/xml
Defined by
W3C, XML 1.0 (first published 1998)
Rule
Every tag closed, one root element

02What is an XML file

XML wraps data in named tags that nest inside each other, such as a book tag holding a title tag. Sitemaps, RSS feeds, maps (KML, GPX), office files, invoices and many business systems use it, and it is the base of many other formats.

The W3C defines what makes a file well-formed: there is exactly one root element, every tag that opens is closed, tags close in the reverse order they opened, attribute values are in quotes, and the characters & and < in text are written as &amp; and &lt;. A program that follows the standard must stop at the first mistake, so a single bad character breaks the whole file.

Two traps are common. Only five entities exist in plain XML (&lt; &gt; &amp; &quot; &apos;), so HTML names such as &nbsp; are errors. And an XML declaration with an encoding, such as UTF-8, must be true: a file saved in another encoding under that declaration shows wrong letters or fails.

A file can also declare its own entities in a DOCTYPE. Programs that expand them can be made to build huge text or read other files, so this tool never expands them. It only reports that they exist.

03Good and bad sides

Good

  • Strict rules mean any compliant program reads it the same way
  • Handles nested data, attributes and several languages
  • Self-describing: tag names say what the data is
  • Many standards are built on it (sitemaps, RSS, SVG, office files)

Bad

  • Verbose: much of the file is tags
  • One unescaped & or a mismatched tag makes the whole file unreadable
  • Entity declarations can be abused, so XML from unknown sources needs care
  • Not a table: nested data must be flattened to become CSV or Excel

04Best for

  • Sitemaps, RSS feeds and standard data exchange

    These formats are defined as XML. Check that the file is well-formed before you upload it.

  • Settings that people edit

    Works, but it is noisy, and one unescaped & breaks the file. JSON or YAML is easier to read and edit.

  • Opening as a spreadsheet

    Only flat, repeating records become a clean table. Convert it first if the data is nested.

  • Files from unknown sources

    Entity declarations can be abused, so check XML from strangers before you open it.

05How to open it

Any system
A text editor, VS Code, or a browser (most show a tree)
Spreadsheets
Excel (File, Open) turns flat XML into a table; LibreOffice Calc can import it too
Programming
Every language has an XML parser

06Convert and compare

Related formats: JSON, YAML, CSV, XLSX

Sources