File Formats
  • Audio
  • Video
  • Images
  • 3D & CAD
  • Documents
  • Data
  • Code
  • System
Data
  • Structured text
  • Binary serialisation
  • Databases
  • Scientific
  • Geospatial
  • Machine learning
  • Messages & calendars
  • Compression
  • Archives
  1. Home
  2. Data
  3. Structured text
  4. XML
.XML
  • Overview

.XML

Extensible Markup Language

Introduction

XML is a text format for documents and data made of nested, named elements. The W3C published XML 1.0 in 1998 as a simpler form of SGML. XML itself only sets the syntax; each use defines its own elements, often with a schema that a validator can check.

Many other formats are XML underneath, including SVG images, GPX tracks, RSS feeds and the parts inside a Word document. A file saved with the plain .xml extension is usually data or settings for a particular program.

Software

  • Visual Studio Code (Windows, macOS, Linux)
  • Notepad++ (Windows)
  • Oxygen XML Editor (Windows, macOS, Linux)
  • Firefox and other web browsers, which show XML as a tree
  • libxml2 and its xmllint tool (Windows, macOS, Linux)
  • Microsoft Excel, which can import XML data as a table

Structure

An XML file may open with a declaration giving the version and character encoding, <?xml version="1.0" encoding="UTF-8"?>. Without one the encoding is UTF-8, or UTF-16 when the file starts with a byte order mark.

The content is a single root element. An element is a start tag and an end tag around its content, <name>…</name>, or one empty tag, <name/>. Start tags carry attributes as key="value" pairs. Elements nest strictly, with no overlap. Text may use entity references such as &amp; and &lt;, and may include comments, processing instructions and CDATA sections. Namespaces let one file mix the elements of several vocabularies.

  1. 0Declaration version and encoding (optional)text
  2. …Document type or comments (optional)text
  3. …Root element every other element nests inside ittext
An XML document: declaration, then one root element.
© 2026 fileformats.org About Contact Made by Lewpen