file in abyss
Back to formats

Data

XML Extensible Markup Language

Extensible Markup Language is a data format commonly identified by .xml. Use the listed signatures, MIME types, and structure notes to validate files beyond the extension.

Extensions .xml
MIME application/xml, text/xml

Magic numbers

Analyze your file
offset 0 Extensible Markup Language leading signature
3C 3F 78 6D 6C
<?xml
offset 0 Extensible Markup Language leading signature
3C
<

Structure

  1. Optional XML declaration
  2. Root element
  3. Elements
  4. Attributes
  5. Text nodes

Caveats

  • Do not trust the extension alone. Check the MIME type, the first bytes such as 3C 3F 78 6D 6C, and format-specific structure when possible.
  • Container formats and damaged files can share the same opening bytes, so deeper validation may be required for production upload, preview, or conversion flows.

Detection example

SIGNATURE = bytes.fromhex("3c3f786d6c")
OFFSET = 0

def is_xml(path: str) -> bool:
    with open(path, "rb") as f:
        f.seek(OFFSET)
        head = f.read(len(SIGNATURE))
    return head == SIGNATURE

Practical usage

Use cases

Extensible Markup Language is used for data exchange, imports, exports, parser testing, and validation workflows. Encoding, delimiters, versions, and container structure often change implementation behavior.

Common detection mistakes

  • The .xml extension alone does not prove the file contents. Upload and conversion flows should combine extension, MIME type, leading bytes, and format-specific structure checks.
  • Extensible Markup Language can start with signatures such as 3C 3F 78 6D 6C or 3C, but related containers and damaged files may require additional validation.

Security notes

Untrusted input is not safe just because the format was detected. Account for parser exceptions, large files, unexpected encodings, and external references.

Using samples

11 samples help test leading-byte detection, parser errors, upload limits, and download behavior.

Sample files

11 / 11 files
Sample Traits Size Source / license / SHA-256
Data

Small XML Feed

Small XML Feed is a Extensible Markup Language sample generated for file format testing. It can be used to test downloads, parsers, previews, and file type detection.

feed.xml
Type Sample
Small file
174 B
Generated CC0 1.0
SHA-256 d89cd1cd49f29370022d68796f91822e05ba7da6f064d73ddef2f27805d864ab
Download
Data

Blue Sky XML

Blue Sky XML is a Extensible Markup Language sample based on Wikimedia Commons. It can be used to test downloads, parsers, previews, and file type detection.

01-blue-sky.xml
Type Sample
Small file
282 B
SHA-256 bc5c4b587279c801b5ca1a82bf7a0b36af8920ef41262d3f059f1717b63bbe02
Download
Data

Flower Garden XML

Flower Garden XML is a Extensible Markup Language sample based on Wikimedia Commons. It can be used to test downloads, parsers, previews, and file type detection.

02-flower-garden.xml
Type Sample
Small file
353 B
SHA-256 bd78ce2cfb0e58645ffacbf1d524c83d63ca990fdb3822f97bacd3b510ecaf30
Download
Data

Navy Blue Sky XML

Navy Blue Sky XML is a Extensible Markup Language sample based on Wikimedia Commons. It can be used to test downloads, parsers, previews, and file type detection.

03-navy-blue-sky.xml
Type Sample
Small file
386 B
SHA-256 3c6ccde88f123d6bcf4c02063c0da0c324632061ba674fdc387a0b5a5cc97184
Download
Data

Nature of the Sky XML

Nature of the Sky XML is a Extensible Markup Language sample based on Wikimedia Commons. It can be used to test downloads, parsers, previews, and file type detection.

04-nature-sky.xml
Type Sample
Small file
435 B
SHA-256 91b6cba624788fe4d84a48b09826b770f42ecd2d9127314853beb884bb5777b8
Download
Data

Sky Landscape XML

Sky Landscape XML is a Extensible Markup Language sample based on Wikimedia Commons. It can be used to test downloads, parsers, previews, and file type detection.

05-sky-landscape.xml
Type Sample
Small file
477 B
SHA-256 cb040898b20920931b8b089ace0ce4fa01e1389e8777620ccddd56b431d3889c
Download
Data

Starry Sky XML

Starry Sky XML is a Extensible Markup Language sample based on Wikimedia Commons. It can be used to test downloads, parsers, previews, and file type detection.

06-starry-sky.xml
Type Sample
Small file
483 B
SHA-256 a4fe70ed3ad95894b2f66924883195c4e0b8b0d0571618d5cbedcb656e1c2dcc
Download
Data

Blue Night Sky XML

Blue Night Sky XML is a Extensible Markup Language sample based on Wikimedia Commons. It can be used to test downloads, parsers, previews, and file type detection.

07-blue-night-sky.xml
Type Sample
Small file
543 B
SHA-256 47bd294b1478afbdb31ba970ab3939a6ed074ad71160fc27133c52297be8dacd
Download
Data

Hibiscus Flower XML

Hibiscus Flower XML is a Extensible Markup Language sample based on Wikimedia Commons. It can be used to test downloads, parsers, previews, and file type detection.

08-hibiscus-flower.xml
Type Sample
Small file
620 B
SHA-256 4ae71ebe9f0bec672d08cc49a8a916fe7561ac93c03d9d3bf51e9b543e44cac0
Download
Data

Arctic Sky XML

Arctic Sky XML is a Extensible Markup Language sample based on Wikimedia Commons. It can be used to test downloads, parsers, previews, and file type detection.

09-arctic-sky.xml
Type Sample
Small file
599 B
SHA-256 90c29e633d5e9ffbb71402c5727649a582944ba51a9a3d4ff296963a7df49a35
Download
Data

NASA Blue Marble XML

NASA Blue Marble XML is a Extensible Markup Language sample based on NASA Image and Video Library. It can be used to test downloads, parsers, previews, and file type detection.

nasa-blue-marble-2012-east.xml
Type Sample
Small file
909 B
SHA-256 39372c25c4ead10c9953ef1e90ebd6b147ae9f1ef481a563eb5d02b9114940ad
Download

Frequently asked questions

What is the magic number (file signature) of Extensible Markup Language?

Extensible Markup Language files begin with the byte signature 3C 3F 78 6D 6C ("<?xml") or 3C ("<"). Detect the format by reading these leading bytes rather than trusting the file extension alone.

What is the MIME type of Extensible Markup Language?

The MIME type for Extensible Markup Language is application/xml, text/xml.

What file extension does Extensible Markup Language use?

Extensible Markup Language files use the .xml extension. The extension is a convention only and does not guarantee the file contents, so combine it with signature and structure checks.

Related formats