.XML

XML File

Extensible Markup Language Document
Ask a question
QUICK ANSWER

An XML file is a plain-text document that stores structured data in nested, custom tags. Because it is just text, any text editor opens it - drag it into a browser tab for a quick, collapsible view, or use Visual Studio Code or Notepad++ for editing. You do not run an XML file; programs read it.

Developer: W3C (World Wide Web Consortium) Category: Data Files Open standard MIME: application/xml
OPENS ON Windows macOS Linux Web
Related: .PKPASS · .DAT · .JSON · .RIS

On this page

19k+ extensions indexed
Last reviewed Sep 6, 2026

Not sure what your file is?

Drop any file into our identifier - we read just the first bytes to name the format.

Identify a file

What is the XML file format?

.xml files store data in the Extensible Markup Language format, a plain-text standard developed by the W3C. XML files can represent any data structure in plain text, making them suitable for storing, sharing and transporting data between applications across the internet.

XML uses markup structures - nested tags and attributes - that define the rules an encoding process must follow to produce documents that are both machine-readable and human-readable. It was designed as a more accessible implementation of SGML (Standard Generalized Markup Language), simplified for web use. Files typically begin with the declaration <?xml version="1.0" encoding="UTF-8"?>, and the MIME type is application/xml.

XML files use Unicode encoding (UTF-8 by default) and can be opened and edited with any standard text editor. Because the format is self-describing - each element is named and nested within a clear hierarchy - the data can be inspected without dedicated software, though processing or querying it programmatically requires a parser or a query language such as XPath.

XML is in many ways similar to .HTML, as both formats use markup language to represent structured content. HTML is focused on web page presentation and interaction, while XML describes content in relation to the data itself. The two formats are used together in many web applications. XML also serves as the foundation for related standards such as .XSD validation schemas, .XSL transformation stylesheets, and .RSS syndication feeds.

Security & safety

RISK: MEDIUM

An XML file is plain text and contains no executable code, so reading one is safe. The real risks are at the PARSER, not the file: XML External Entity (XXE) attacks abuse <!DOCTYPE>/<!ENTITY> declarations to read local files or trigger network requests, and "billion laughs" entity-expansion can exhaust memory (denial of service). These only matter when software parses untrusted XML with external entities and DTD processing enabled - modern parsers disable these by default. For an end user just opening an .xml to read it, there's no danger; the caution is for developers processing untrusted XML. Also beware files that look like 'data.xml' but are actually something else renamed.

Format details

in a nutshell
FULL NAMEExtensible Markup Language Document
DEVELOPERW3C (World Wide Web Consortium)since 1998 (XML 1.0 W3C Recommendation, February 10, 1998)
CATEGORYData Files
MIME TYPEapplication/xml
TYPEPlain-text, tag-based structured data (Unicode)
STANDARDOpen · royalty-free
MAGIC BYTES · FILE SIGNATURE
OFFSET
0001020304
HEX
3C3F786D6C
ASCII
<?xml
Plain text, not binary. Files usually begin with the declaration <?xml version="1.0" encoding="UTF-8"?> (hex 3C 3F 78 6D 6C), but the declaration is optional, so a valid XML may simply start with its root element "<". A UTF-8 BOM (EF BB BF) or a UTF-16 BOM (FF FE / FE FF) may precede the text. Identity is by content (well-formed tag tree), not a fixed magic number.

Programs that open XML files

Windows7 apps
Microsoft Excel Paid Data > Get Data / Open to import tabular XML into a spreadsheet (Excel maps it to rows/columns).
Microsoft Visual Studio Freemium Full XML editor with schema validation and IntelliSense; good when working in a .NET project.
Notepad Open-source Open to read/edit with XML highlighting; the XML Tools plugin pretty-prints and validates.
Visual Studio Code Free Open the .xml for syntax highlighting and folding; add the Red Hat XML extension for validation and formatting (Shift+Alt+F to pretty-print).
Web browser (Edge/Chrome/Firefox) Built-in Drag the .xml into a browser tab to see the rendered, collapsible tag tree - quickest way to just view it.
Altova XMLSpy Paid Professional XML IDE - graphical grid/schema views, validation, XSLT/XPath. (URL updated from old altova.com/xmlspy.html.)
Notepad (built-in) Built-in Always-available way to read/edit the raw text - no highlighting, but instant.
macOS3 apps
TextEdit Built-in Open as plain text (Format > Make Plain Text) to read/edit raw XML.
BBEdit Freemium Mac code editor with XML syntax coloring and reflow; free mode opens/edits XML.
Visual Studio Code Free Open and edit with the Red Hat XML extension for validation and formatting.
Linux3 apps
Visual Studio Code Free Open with the Red Hat XML extension for schema-aware editing and validation.
gedit / GNOME Text Editor Open-source Open to read/edit with XML syntax highlighting (GNOME Text Editor replaces gedit on newer GNOME).
xmllint (libxml2) Open-source Pretty-print and check well-formedness: xmllint --format file.xml ; validate with --schema.
Web1 app
Code Beautify XML Viewer Free Paste XML to format, validate and tree-view it in the browser; also XML->JSON/CSV. Avoid pasting sensitive data into online tools.

Technical details

deep spec
File encodingUnicode only; UTF-8 is the default when no declaration is present; UTF-16 and UTF-32 are supported and must be declared in the XML prolog
MIME type`application/xml` (primary, per RFC 7303); `text/xml` accepted for legacy compatibility; specific dialects may register their own type (e.g. `application/rss+xml`)
File signatureNo fixed binary magic number; files typically open with the optional XML declaration `<?xml` (hex `3C 3F 78 6D 6C`); a UTF-8 BOM (`EF BB BF`) or UTF-16 BOM (`FF FE` / `FE FF`) may precede it
Document structureStrict hierarchy: exactly one root element; unlimited nesting of child elements; opening tags may carry named, quoted attributes; the entire tree must be well-formed
Well-formedness rulesAll tags must be closed or self-closed; elements must not cross-nest; attribute values must be quoted; five predefined entities (&amp;, &lt;, &gt;, &quot;, &apos;) handle reserved characters
Validation mechanismsDTD (Document Type Definition - inline or external `.dtd` file, older standard) and XSD (XML Schema Definition - a `.xsd` file itself written in XML, with a richer type system); Schematron offers rule-based validation
Namespace support`xmlns` and `xmlns:prefix` declarations bind element and attribute names to a URI, preventing collisions when combining vocabularies from multiple sources
CDATA sections`<![CDATA[...]]>` blocks let raw text containing <, >, and & appear without entity escaping; useful for embedding HTML fragments or script code
Processing instructions`<?target instruction?>` syntax embeds application-specific directives (e.g. `<?xml-stylesheet type="text/xsl" href="style.xsl"?>`) outside the XML data model
Query languagesXPath 1.0/2.0/3.1 addresses individual nodes inside a document; XQuery provides SQL-style querying over XML datasets; both are W3C-standardised
XSLT transformation`.xml` files can be transformed to HTML, plain text, or other XML vocabularies at runtime by an XSLT processor merging the source document with a `.xsl` or `.xslt` stylesheet
Comment syntax`<!-- text -->` comments may appear anywhere outside a tag; double hyphens are forbidden inside the comment body; comments are excluded from the XML data model
Newline normalizationConforming parsers normalize \r\n and bare \r sequences to \n before processing, ensuring consistent line-ending behavior across platforms
Entity declarationsNamed entities (&name;) and numeric character references (&#nnnn; decimal or &#xHHHH; hex) embed any Unicode code point; custom entities can be declared in a DTD
Prolog structureAn XML document consists of an optional XML declaration, an optional DOCTYPE declaration, optional processing instructions and comments, followed by exactly one root element
Dialect ecosystemXML is the base syntax for XHTML, SVG, RSS, Atom, DOCX (Office Open XML), EPUB, KML, and configuration formats used by Android, Maven, Spring, and Java EE
Released1998 (XML 1.0 W3C Recommendation, February 10, 1998)
Open standardYes · royalty-free
Specificationwww.w3.org

XML conversions

Community Q&A

asked by users
Ask a quick question
Get help from people who work with XML files. Be specific - include your system and software version.
No account needed · answers usually within a day

No questions yet - be the first to ask about XML files.

Frequently asked questions

How do I open an XML file?
It's plain text - open it in any text editor, or drag it into a web browser to see a collapsible tag tree. For comfortable editing use Visual Studio Code or Notepad++ (syntax highlighting, formatting, validation).
How do I convert XML to Excel?
In Excel use Data > Get Data > From XML (or File > Open and choose 'As an XML table'). It works well for regular, tabular XML; deeply nested XML may need flattening with Power Query or an XSLT first.
What is the difference between XML and HTML?
HTML has a fixed set of tags for displaying web pages; XML lets you define your own tags to describe data and has stricter rules (case-sensitive, every tag must close, one root). XML carries data; HTML presents pages.
What's the difference between XML and JSON?
Both store structured data as text. XML uses tags and supports namespaces, schemas (XSD) and mixed content; JSON is terser and dominant in web APIs. XML still rules documents, enterprise and standards; JSON rules lightweight data exchange.
Why do I get an 'XML parsing error'?
The XML isn't well-formed - usually an unclosed or mismatched tag, an illegal character (a raw &, < or >), missing root element, or wrong encoding. Open it in a browser or VS Code; both point to the offending line.
Can I open an XML file in a browser?
Yes. Chrome, Edge and Firefox render XML as an expandable/collapsible tree, which is the fastest way to read its structure without installing anything.
What is an XSD or XSL file next to my XML?
An XSD is the schema (rulebook) that defines and validates the XML's structure; an XSL/XSLT is a stylesheet that transforms the XML into HTML, text or another format. They work with the XML but aren't the data themselves.

References

1W3C - Extensible Markup Language (XML) 1.0 specificationwww.w3.org
2W3C - XML technology overviewwww.w3.org

Keep exploring

across the database

Top extensions this week

1.AQQAQQ Instant Messenger File
2.BCBitComet Incomplete Download File
3.CRDOWNLOADChrome Partial Download File
4.PARTPartial Download File
5.BINCD/DVD Disc Image (BIN/CUE)
6.MDMarkdown Document
7.EXEWindows Executable (Portable Executable)
8.NOMEDIAAndroid No-Media Marker File
9.RPMSGRestricted Permission Message
10.AVIFAV1 Image File Format (AVIF)

Related extensions

.PKPASSApple Wallet Pass (formerly Passbook)
.DATProgram Data File (generic)
.JSONJavaScript Object Notation file
.RISResearch Information Systems citation file
.OFXOpen Financial Exchange
.CSVComma-Separated Values

Free file tools

An in-browser file identifier and image converter - everything runs on your device.

Open the toolbox

Browse file extensions A-Z