Sample XML files
Free XML test files from 5 KB to 1 GB. Pick a size and download, or type any size you need.
Sample XMLClassic · 2.2 KB
Eight nested records with both attributes and child elements, so a converter has to decide how to represent each
5 KB XML
17 records
10 KB XML
36 records
100 KB XML
360 records
500 KB XML
1,795 records
1 MB XML
3,583 records
5 MB XML
Made on your device
10 MB XML
Made on your device
25 MB XML
Made on your device
50 MB XML
Made on your device · saved in pieces
100 MB XML
Made on your device · saved in pieces
500 MB XML
Made on your device · saved in pieces
1 GB XML
Made on your device · saved in pieces
Free for any use, including commercial. Made by this site, with no third-party content and no signup.
What is inside
- An XML declaration with an explicit UTF-8 encoding
- A root element with an attribute
- Eight nested records, each with attributes and child elements
- A count attribute, for checking a converter kept it
- Consistent two-space indentation
Try it with these tools
They run in your browser. The file you downloaded stays on your device.
- XML to JSON Convert XML into clean, readable JSON.
- XML to Excel Turn XML records into spreadsheet rows.
- XML to CSV Flatten XML records into CSV rows.
- XML Formatter Format XML, see the error line, browse it as a tree, test an XPath.
- XML Minifier Remove the whitespace between XML tags, keeping text content intact.
- JSON to XML Convert a JSON document into XML.
About XML files
XML predates JSON by a decade and was designed for documents rather than data structures. You can see this in its two ways of attaching information to an element: attributes and child elements. That choice is the main difficulty when you convert XML to anything else.
There is no single right answer for what an attribute becomes in JSON. Most converters prefix them, commonly with @ or a similar marker, to keep them apart from child elements. This sample uses both deliberately so you can see what your converter chose.
"Well-formed" and "valid" mean different things in XML. Well-formed means the syntax is correct: tags nest and close properly. Valid means it also conforms to a schema. This file is well-formed; it has no schema to be valid against.
Sources: Extensible Markup Language (XML) 1.0 (W3C)
Questions
Is this XML valid?
It is well-formed, and that is what a parser needs. Validity is a separate claim about conforming to a schema, and this document has no schema attached, so there is nothing to be valid against.
How will the attributes convert to JSON?
That depends on the converter. It is the reason the sample uses attributes and child elements together. Most prefix attributes with @ to keep them distinct. Run it through and look.
Is XML obsolete?
No. It is less fashionable than JSON for web APIs, but it remains the basis of .docx and .xlsx, of RSS, SVG and sitemaps, and of a great deal of financial and government data exchange.
Also searched as: sample xml file download, dummy xml file, test xml file, example xml file, 1 MB xml file, 10 MB xml file, 100 MB xml file, 1 GB xml file, free xml for testing.
For developers: exact bytes and SHA-256
Sizes are decimal (1 MB = 1,000,000 bytes). The hosted files never change between builds, so these checksums stay valid.
| File | Bytes | SHA-256 |
|---|---|---|
| sample-5kb.xml | 5,000 bytes | 7dd9afcc0097734b9b3bc4536504155097dff3e9e8709088f2342b894c764bf9 |
| sample-10kb.xml | 10,000 bytes | 4e4b1cdf45bacd3401fb3d80c85aed409b86ff069e4e2b19a284523838314bd6 |
| sample-100kb.xml | 100,000 bytes | fe378e7b24f5029b593e8efc66bad05dfe13930baa7b77133962f4b2892dd958 |
| sample-500kb.xml | 500,000 bytes | 5a3ce0a7f0b7bbf13a8943154842fe7e8edaf3d86a3a8bcff971806c0fd59bda |
| sample-1mb.xml | 1,000,000 bytes | 0f944676f53f51274542bb9224345faf397cb324027cd1009855e080b27aef86 |