FormatterHQ

Random XML Generator

Generate well-formed XML test data with realistic names, emails, companies and dates. Choose fields and row count to mock feeds, SOAP payloads and imports.

Output XML
Ready.

How to use the Random XML Generator

  1. Set the number of records, up to 5,000.
  2. List the fields you want as comma-separated names, for example id,fullName,email,company.
  3. Generate the XML document.
  4. Copy or download the XML and load it into your importer, test or mock service.

Well-formed XML test data

XML is still everywhere: enterprise integrations, SOAP services, product feeds, configuration files and document formats. When you build or test code that reads XML, you need sample documents with realistic content. This random XML generator creates a complete document with an XML declaration, a root element and one child element per record.

Example output from the random XML generator

<?xml version="1.0" encoding="UTF-8"?>
<records>
  <record>
    <id>1</id>
    <fullName>Hannah O'Connell</fullName>
    <email>hannah.oconnell@hotmail.com</email>
    <company>Brekke and Sons</company>
    <city>North Kaylee</city>
    <date>2024-11-02</date>
  </record>
</records>

Each field becomes an element named after it. Special characters are escaped (& becomes &amp;, < becomes &lt;), so the output stays well-formed whatever the values contain. That makes it a useful check that your parser decodes entities correctly.

Available fields

Type a comma-separated list of field names in the order you want the columns. Unknown names produce an error listing all valid ones. The full list is:

id, uuid, firstName, lastName, fullName, name, gender, email, username, password, phone, company, jobTitle, street, city, state, zip, country, countryCode, latitude, longitude, date, datetime, birthdate, age, boolean, active, number, price, product, ip, url, color, word, sentence, paragraph, avatar, iban, currency

id is a sequential number starting at 1, uuid is a random version 4 UUID, age is between 18 and 90, date and datetime fall within the past five years, and number is an integer from 0 to 10,000. Names, addresses, companies and products come from an English-language fake-data library.

Ideas for using random XML

  • Import testing – verify that an XML import maps each element to the right database column.
  • XPath practice – generate a few hundred records and query them in the XPath tester, for example //record[age > 60]/fullName.
  • XSLT development – transform the records into HTML or another XML schema.
  • Performance – 5,000 records produce a document large enough to compare DOM and streaming parsers.
  • Format conversion – turn the data into JSON with XML to JSON to test both code paths with identical content.

Customizing the structure

The generator uses <records> as the root and <record> for each item, with all values as child elements rather than attributes. If your schema needs different element names, attributes or namespaces, a quick search-and-replace in your editor usually does the job, and you can then check the result in the XML validator.

Privacy

All data is fictional and generated in your browser. Email addresses use common provider domains, so treat them as placeholders and never send messages to them.

Frequently asked questions

Is the generated XML valid?
It is well-formed: it has a single root element, properly nested tags and escaped special characters. Validity against a specific XSD schema depends on your schema, since the element names follow the field names you choose.
Can I change the root and record element names?
The generator always uses records as the root element and record for each item. Rename them with a find-and-replace in your editor, which is safe because these names do not appear elsewhere in the output.
Can values be written as attributes instead of elements?
No, every field becomes a child element. Convert with an XSLT transform or adjust the structure in your editor if you need attributes.
How large can the document be?
Up to 5,000 records per run. With many fields this produces a document of several megabytes, which is useful for performance testing.

Last updated September 26, 2026

Related tools

Random Alphanumeric Generator Generate letters-and-digits codes for vouchers, reference IDs and usernames in mixed, upper or lower case. Random Binary Generator Generate random binary numbers (strings of 0s and 1s) of any bit length. Random Byte Generator Generate cryptographically secure random bytes as hex, Base64, decimal, binary or a code array. Random Color Generator Generate random colours as HEX, RGB or HSL codes with a swatch preview for inspiration and testing. Random CSV Generator Generate realistic fake CSV test data — names, emails, addresses, dates and more — with custom fields. Random Date Generator Generate random dates or date-times between two dates in ISO, US, EU, long, Unix or RFC formats. ULID Generator Generate sortable ULIDs (Universally Unique Lexicographically Sortable Identifiers) with monotonic ordering, in bulk, using secure randomness. UUID Generator Generate random UUID v4 or time-ordered UUID v7 identifiers in bulk, with case, hyphen and brace options. Lorem Ipsum Generator Generate lorem ipsum placeholder text by paragraphs, sentences or words, optionally wrapped in HTML <p> tags. Memorable Password Generator Generate easy-to-remember passphrases from random English words, with separators, numbers and symbols. Nano ID Generator Generate secure, URL-friendly Nano IDs with custom length and alphabet, plus a collision-probability estimate. MongoDB ObjectId Generator Generate valid 12-byte MongoDB ObjectIds for the current time or any date, as hex, ObjectId() or Extended JSON.