Skip to content

What is an XML file?

XML stores data as labelled, nested tags. It is wordier than JSON but very precise about structure, and it still sits underneath feeds, office documents and a great deal of business software. You can convert XML files here, both into the format and out of it.

Specification

XML format specifications
Full nameExtensible Markup Language
Extensions.xml
Media typeapplication/xml
CompressionUncompressed
Transparency
Animation
Multiple pages
Colour depthUnicode element tree with namespaces, DTD or XSD validation
Size limits
Introduced1998
Developed byW3C
StandardOpen
Browser supportEvery browser, including older ones

What XML is used for

  • RSS and Atom feeds, and sitemap files for search engines
  • Enterprise messaging over SOAP and industry data interchange schemas
  • The internal parts of DOCX, XLSX, ODT and EPUB packages
  • Configuration in Java, .NET and Android projects

Strengths and limitations

What XML does well

  • Schemas allow a document to be validated before it is processed
  • Namespaces let independent vocabularies be mixed in one document
  • Mature tooling for querying and transforming with XPath and XSLT

Where XML falls short

  • Very verbose, with every element name repeated in its closing tag
  • The attribute versus child element choice makes mapping to objects messy
  • Entity expansion features have caused a long line of security problems

Convert XML to

Every target this format can be written out as, each on its own page.

Convert to XML

Everything that can be turned into a XML file.

Questions about XML

What is a .xml file?

XML stores data as labelled, nested tags. The extension .xml identifies it, and its media type is application/xml.

How do I open an XML file?

Any current browser will open it directly, so dragging the file into a tab is usually enough. Most operating systems also preview it without extra software.

Is XML lossy or lossless?

Uncompressed. Nothing is discarded, so repeated saves never degrade the contents.

What is XML good for?

Schemas allow a document to be validated before it is processed. Namespaces let independent vocabularies be mixed in one document. Mature tooling for querying and transforming with XPath and XSLT. In practice that makes it a good fit for RSS and Atom feeds, and sitemap files for search engines, and Enterprise messaging over SOAP and industry data interchange schemas.

What are the drawbacks of XML?

Very verbose, with every element name repeated in its closing tag. The attribute versus child element choice makes mapping to objects messy. Entity expansion features have caused a long line of security problems.

Other data formats

Data converter or the full format reference