How to use it
- Paste your XSD schema, or press Example.
- Choose Make: XML or JSON. To start from another top-level element, type its name under Root element.
- Untick Include optional parts to leave out optional elements and attributes, then copy the sample.
What goes into the sample
- Elements in order, from
xs:sequence,xs:alland groups; for anxs:choice, the first option. - Named and inline types,
xs:extensionof other complex types, and simple content with attributes. - The first value of an
xs:enumeration, fixed and default values, and a plain sample for each built-in type, such as2026-01-31forxs:date. - Length and minimum limits where they are easy to meet.
Limits
Each element appears once, even when more are allowed. Values may not match a xs:pattern. Types that come from xs:import or xs:include are not loaded, because the editor makes no requests; they appear as text, and the tool says so. Elements that contain themselves are stopped after one level. The JSON sample uses the layout of JSON to XML, where attributes start with @.
Example
Made-up input, and what XSD to Sample XML and JSON returns for it. Long text is shortened.
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="urn:example:shop" xmlns="urn:example:shop" elementFormDefault="qualified">
<xs:element name="order" type="Order"/>
<xs:complexType name="Order">
<xs:sequence>
<xs:element name="customer" type="xs:string"/>
<xs:element name="placed" type="xs:date"/>
<xs:element name="status" type="Status"/>
<xs:element name="item" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<xs:element name="qty" type="xs:positiveInteger"/>
<xs:element name="price" type="xs:decimal"/>
</xs:sequence>
<xs:attribute name="sku" type="xs:string" use="required"/>
</xs:complexType>
</xs:element>
<xs:element name="note" type="xs:string" minOccurs="0"/>
</xs:sequence>
<xs:attribute name="id" type="xs:int" use="required"/>
</xs:complexType>
<xs:simpleType name="Status">
<xs:restriction base="xs:string">
…<?xml version="1.0" encoding="UTF-8"?>
<ns:order xmlns:ns="urn:example:shop" id="1">
<ns:customer>text</ns:customer>
<ns:placed>2026-01-31</ns:placed>
<ns:status>open</ns:status>
<ns:item sku="text">
<ns:qty>1</ns:qty>
<ns:price>1.5</ns:price>
</ns:item>
<ns:note>text</ns:note>
</ns:order>Questions
Is the sample guaranteed to be valid?
No. It follows the schema closely, but patterns and some limits are not applied. Check it with a validator before you rely on it.
Can it make a schema from XML?
Yes, with the XSD generator.