Random XML Generator
Create sample XML documents for parser checks, demos, and development. Set the maximum nesting depth and number of children per element, then copy or download the result.
Random XML settings
Locally generates a random tree with safe element names. Limits: depth 1–8, up to 8 children per element, 2,000 elements, and 1 MB.
Locally generates a random tree with safe element names. Limits: depth 1–8, up to 8 children per element, 2,000 elements, and 1 MB.
A QUICK WALKTHROUGH
How to use this tool
- Choose a maximum depth and maximum number of child elements per element, from 1 to 8.
- Select Generate XML to create a randomly shaped, well-formed XML document.
- Review, copy, or download the generated sample.
Control the tree size
Set a maximum nesting depth and maximum number of children at each element. The generated shape varies randomly within those limits and has a hard cap of 2,000 elements.
Well-formed sample XML
The generator uses fixed valid element names and escapes ampersands, angle brackets, quotation marks, and apostrophes in text values. It does not generate namespaces, schemas, DTDs, or application-specific structures.
Local processing and safe limits
Generation happens in your browser; no XML is uploaded. The output is limited to 1 MB. Values are sample data for parser checks and development, not security-sensitive secrets.
GOOD TO KNOW
Common questions
Is every result valid XML?
The generator creates a document with matched tags and escapes special characters in text. It does not validate an application-specific schema.
What does maximum depth mean?
It limits the number of nested sample-element levels below the root element.
Can I choose the exact number of elements?
You choose an upper bound for children at each level; the tree shape and exact count vary randomly, up to 2,000 elements total.
Is the generated XML uploaded?
No. It is generated locally in this browser.