XSD Generator (XML to XML Schema)
Generate an XML Schema (XSD) from one or more XML samples: element structure, minOccurs/maxOccurs, required attributes and inferred simple types.
A schema inferred from samples only knows what the samples show: review minOccurs, required attributes and types, and add enumerations, patterns or ranges where your data has rules.
An XML Schema (XSD) describes which elements and attributes an XML document may contain, how often, in what order and with what types; validators, code generators and integration partners all ask for one. Writing it from scratch is slow. Paste one or more sample documents and get a starting XSD: elements, nesting and order, minOccurs and maxOccurs from what the samples show, required and optional attributes, and simple types inferred from the values. Choose nested (Russian doll) or named-type (Venetian blind) design.
How to use this tool
- Paste a sample document — or several, separated by a line with only ---, to cover optional and repeated parts.
- Choose Russian doll (one nested declaration) or Venetian blind (reusable named complex types).
- Decide whether simple types are inferred or left as xs:string.
- Copy the XSD, then tighten it by hand: enumerations, patterns, lengths and ranges.
Formula
element seen in every parent → minOccurs 1 · missing somewhere → minOccurs="0" · more than once in a parent → maxOccurs="unbounded" · attribute on every element → use="required"
Simple types: xs:boolean for true/false, xs:integer for whole numbers, xs:decimal for decimals, xs:date and xs:dateTime for ISO 8601 values that are real calendar dates, otherwise xs:string (also when a value is sometimes empty). Elements with attributes and text use simpleContent; elements that are always empty get an empty complexType. If children appear in different orders, xs:all is used (or an unbounded xs:choice when some repeat). The root's namespace becomes the targetNamespace.
Example
The sample catalog gives <xs:element name="catalog"> containing book with maxOccurs="unbounded". Each book has a required id and an optional lang attribute; title is xs:string; price uses simpleContent with base xs:decimal and a required currency attribute; published is xs:date with minOccurs="0" (only the first book has it); tag is xs:string with minOccurs="0" and maxOccurs="unbounded".
Frequently asked questions
Is the generated schema final?
No — it describes your samples, not your rules. A field that happened to be present everywhere becomes required, and values become as generic as the samples allow. Review it before handing it to partners.
Russian doll or Venetian blind?
Russian doll nests every declaration inside its parent, which is compact and easy to read. Venetian blind gives each complex type a name so it can be reused and extended, which suits larger schemas and code generators.
Can I validate XML against the XSD here?
Not yet — this site checks well-formedness with the XML Validator. Use xmllint --schema, an IDE or your platform's validator for XSD validation.
Is my XML uploaded?
No. The schema is generated in your browser.
Sources
Last updated:
Page address with these inputs: https://kakao.mobile/tools/xsd-generator/
Cite or embed this tool
kakaoCalc. (2026, November 8). XSD Generator (XML to XML Schema). https://kakao.mobile/tools/xsd-generator/
“XSD Generator (XML to XML Schema).” kakaoCalc, 8 Nov. 2026, kakao.mobile/tools/xsd-generator/.
Paste this code into your page. The widget runs in your visitors' browsers, shows no ads and keeps a link back to this page. Embedding terms