XML Generator
Generate sample XML documents with fake data.
Fields
XML Generator – Create Sample XML Data Online
The XML generator creates realistic sample XML documents in seconds. Define the root element, the record element, and a list of fields, choose how many records you need, and the XML is ready to copy or download as a .xml file. No more typing test data by hand or copying production records that contain personal information.
How it works
- Set the root element name (for example
customers) and the record element name (customer). - Add, rename, or remove fields. For every field pick a data type — sequential ID, UUID, full name, email, phone, product, price, date, boolean, and more.
- Mark fields as attributes where your target format expects them, such as an
idon each record. - Choose the number of records, the indentation, and whether to include the
<?xml ... ?>declaration.
The document updates immediately and always contains well-formed XML with properly escaped special characters, so names with ampersands or apostrophes never break it.
Reproducible test data
Values come from a seeded generator: the same field list and seed produce the same file every time, which keeps snapshot tests and documentation examples stable. Press New random data whenever you want different values.
What to use generated XML for
- Testing XML parsers, importers, and ETL jobs with realistic volumes.
- Filling UI prototypes and tables with believable content.
- Preparing input for exercises with XPath or an XSLT stylesheet.
- Demonstrating data conversions — generate XML, then try XML to JSON, XML to CSV, or XML to Excel.
Privacy
Generation happens entirely in your browser. Nothing is sent to a server, and no real personal data is involved.
Related tools
Need tables instead of XML? The SQL Table Generator builds CREATE TABLE statements, and the XML Viewer lets you explore the generated file as a tree.
Frequently Asked Questions
What kinds of fake data can I generate?
Each field has a type: sequential IDs, UUIDs, names, emails, phone numbers, companies, cities, countries, products, prices, dates, booleans, statuses, words, and sentences. The values look realistic but are invented, so the files are safe to share, commit to a repository, or use in public demos.
Can a field be an attribute instead of an element?
Yes. Tick the attribute checkbox of a field and it is written as an attribute of the record element, e.g. <customer id="1">, instead of a child element. Mixing both styles lets you mimic the shape of a real schema.
How many records can I create?
Between 1 and 1,000 records per document. That covers most tests of parsers, imports, and UI tables; for load testing, generate a file and duplicate it.
Why do I get the same data every time?
The generator uses a seeded random number generator, so the same settings reproduce the same document — handy for stable test fixtures. Press “New random data” to get a fresh set of values.