.xml

What is a .xml file?

Extensible Markup Language · Code and data · W3C · 1998

XML is a text format for structured data that uses nested tags, much like HTML. It is verbose but self-describing and strict, which made it the backbone of countless config files, feeds and document formats such as DOCX.

Category
Code and data
Type
Plain text
Is a .xml file safe to open? Generally safe, but XML parsers can be tricked by malicious entity definitions. Modern libraries disable those by default.

What is a .xml file used for?

XML wraps data in named tags that can nest, letting you describe complex structure in a way both people and programs can parse reliably.

It is more verbose than JSON, which has replaced it for many web APIs, but XML remains everywhere: RSS feeds, sitemaps, Office documents and enterprise systems all use it.

Because it is plain text with a clear structure, any editor opens it and validators can check it against a schema.

How to open a .xml file

The .xml format opens in the following apps, grouped by operating system. If one app does not work, try another from the same list. For a step-by-step walkthrough, see how to open a .xml file.

Windows

  • Notepad++
  • VS Code
  • any browser

macOS

  • VS Code
  • any browser

Linux

  • VS Code
  • any browser

Web

  • Browsers display XML as a tree

How to convert a .xml file

You can convert a .xml file to JSON, CSV, YAML using a conversion tool or the export menu of an app that opens it.

.xml file signature (magic bytes)

Programs recognise a .xml file by the bytes at the start of the file, not by its name. These are the signatures for XML. For a full breakdown, see the XML file signature page.

Hex signatureOffsetNote
3C 3F 78 6D 6C0'<?xml'

See the full magic-numbers reference for every format.

Frequently asked questions

What is a .xml file?

XML is a text format for structured data that uses nested tags, much like HTML. It is verbose but self-describing and strict, which made it the backbone of countless config files, feeds and document formats such as DOCX.

Is XML the same as HTML?

They look similar and share ancestry, but HTML describes web pages with a fixed set of tags, while XML lets you define your own tags for any kind of data.

Comparisons

Related formats

Sources

Details on this page were checked against authoritative references: