Free XML sample, test and dummy files

Structured, self-describing documents built from nested elements and attributes. Download valid XML test files in 19 exact sizes, from 1 KB to 100 MB, each with a checksum. Or create one of any size up to 1 GB.

Extension
.xml
MIME type
application/xml
Kind
Text
Category
Data

Create a XML file of any size

Choose any size from 156 bytes to 1 GB. The file is made in your browser, so nothing is downloaded from our server. Smaller files usually finish quickly; generation time depends on your device and format. Larger ones are streamed straight into your downloads list in browsers that support it (current Chrome, Edge and Firefox on computers and Android); elsewhere, such as Safari and every browser on iPhone and iPad, the largest size is lower and is shown below.

XML files by size

Every file below is a valid Extensible Markup Language file of exactly the stated size. Open a file's page for its checksum and contents, and to preview it in your browser before downloading.

XML sample files by size
FileSizeContentsDownload
1 KB XML samplesample-xml-1kb.xml 1 KB1,024 bytes Records: 2 Download XML
5 KB XML samplesample-xml-5kb.xml 5 KB5,120 bytes Records: 13 Download XML
10 KB XML samplesample-xml-10kb.xml 10 KB10,240 bytes Records: 29 Download XML
25 KB XML samplesample-xml-25kb.xml 25 KB25,600 bytes Records: 78 Download XML
50 KB XML samplesample-xml-50kb.xml 50 KB51,200 bytes Records: 158 Download XML
100 KB XML samplesample-xml-100kb.xml 100 KB102,400 bytes Records: 318 Download XML
200 KB XML samplesample-xml-200kb.xml 200 KB204,800 bytes Records: 639 Download XML
500 KB XML samplesample-xml-500kb.xml 500 KB512,000 bytes Records: 1,597 Download XML
1 MB XML samplesample-xml-1mb.xml 1 MB1,048,576 bytes Records: 3,267 Download XML
2 MB XML samplesample-xml-2mb.xml 2 MB2,097,152 bytes Elements: 6,527 <customer> records Download XML
3 MB XML samplesample-xml-3mb.xml 3 MB3,145,728 bytes Records: 9,789 Download XML
5 MB XML samplesample-xml-5mb.xml 5 MB5,242,880 bytes Elements: 16,270 <customer> records Download XML
10 MB XML samplesample-xml-10mb.xml 10 MB10,485,760 bytes Elements: 32,471 <customer> records Download XML
15 MB XML samplesample-xml-15mb.xml 15 MB15,728,640 bytes Records: 48,694 Download XML
20 MB XML samplesample-xml-20mb.xml 20 MB20,971,520 bytes Records: 64,904 Download XML
25 MB XML samplesample-xml-25mb.xml 25 MB26,214,400 bytes Records: 81,115 Download XML
30 MB XML samplesample-xml-30mb.xml 30 MB31,457,280 bytes Records: 97,330 Download XML
50 MB XML samplesample-xml-50mb.xml 50 MB52,428,800 bytes Records: 161,780 Download XML
100 MB XML samplesample-xml-100mb.xml 100 MB104,857,600 bytes Records: 322,895 Download XML

More XML samples

Hand-designed files with realistic content or a specific edge case.

Curated XML sample files
FileSizeContentsDownload
Sample product catalogue XML with namespaces and CDATAsample-product-catalog.xml 1.07 KB1,100 bytes Features: Attributes, entities, CDATA, comment, processing instruction, empty element Download XML
Sample RSS 2.0 feedsample-rss-feed.xml 2.39 KB2,451 bytes Items: 5 Download XML

What is an XML file?

XML marks up data with named elements that nest to form a tree, with attributes on elements and text inside them. It underlies many established formats, including RSS, SVG, SOAP, Office documents and countless enterprise integrations.

A document must be well-formed, meaning every element is closed and properly nested, or a parser will reject it outright. It can additionally be validated against a schema.

How to recognise an XML file

Software recognises an XML file by its file signature: fixed bytes at the start of the file, also called magic bytes or a magic number.

The first bytes of every file. The XML declaration is optional but usual.
Extension.xml
MIME typeapplication/xml
Also seen astext/xml
StandardW3C XML 1.0
EncodingDeclared in the document; UTF-8 by default
ValidationDTD, XML Schema or RELAX NG
FeaturesNamespaces, entities, CDATA sections, processing instructions

What to test for

These are the behaviours that most often go wrong when software handles XML files.

Strengths of XML

  • Mature tooling for validation, transformation and querying.
  • Handles documents with mixed text and markup, which JSON cannot.

Limitations of XML

  • Verbose: the same data is considerably larger than in JSON.
  • Features such as entities make parsers a security concern when misconfigured.

Typical uses of XML test files

  • Testing XML parsers and data import
  • Checking protection against entity attacks
  • Testing feed readers and SOAP clients

Software that opens XML

  • Every programming language
  • Browsers, xmllint and XSLT processors
  • Enterprise integration and publishing systems

Specifications

Related

XML sample files: questions

Do the XML samples use a DTD or entities?
No. They have an XML declaration and no DOCTYPE, so they are safe for parsers with DTD processing disabled.
What is the MIME type of an XML file?
The MIME type is application/xml. You will also meet text/xml in practice. The file extension is .xml.
Is a sample XML file the same as a dummy or example XML file?
Yes. Sample, test, dummy and example XML files are different names for the same thing: an XML file with known contents that stands in for a real one. Any file on this page will do wherever a tutorial or a test plan asks for a dummy XML file.