XSD Generator — Create a Schema from XML
Paste sample XML and press “Generate XSD” to get a schema draft.
Your text and files never leave your browser — nothing is sent to a server.
How to use
- Paste sample XML and press “Generate XSD”. The more variations your sample contains, the closer the result gets to your real structure.
- A child that appears more than once under the same parent gets maxOccurs="unbounded"; one that is missing somewhere gets minOccurs="0". Attributes present everywhere are marked use="required".
- With “Infer value types” on, values that are all integers become xs:integer, decimals xs:decimal, true/false xs:boolean and dates like 2026-10-17 xs:date. Turn it off to use xs:string everywhere.
- Under “Design”, Nested writes child definitions inside their parent, while Flat declares every element at the top level and links them with ref.
FAQ
Can I use the generated XSD as is?
Treat it as a draft inferred from what your sample shows. Elements or values missing from the sample are not covered, so adjust required fields, value ranges and length limits to match your actual rules.
What is the difference between nested and flat?
Nested (Russian Doll) puts child definitions directly inside each element, so the structure is easy to read and elements with the same name are defined separately per location. Flat (Salami Slice) defines every element once at the top level and references it with ref, which makes reuse easy.
Does it handle namespaces?
The root element’s default namespace (xmlns="…") becomes the targetNamespace. Prefixed elements are defined by their local name, so split the result yourself if your document mixes several namespaces.
Related tools
All tools
Unit Converters
- Unit Converter
- Temperature Converter
- Weight Converter
- Area Converter
- Length Converter
- Angle Converter
- Calorie Converter
- Data Size Converter
- Dry Volume Converter
- Electric Charge Converter
- Energy Converter
- Flow Rate Converter
- Force Converter
- Fuel Economy Converter
- Luminous Intensity Converter
- Magnetomotive Force Converter
- Power Converter
- Pressure Converter
- Radiation Dose Converter
- Speed Converter
- Time Unit Converter
- Volume Converter