How to use
Use it in a few seconds:
- Paste your XSD into the input box (or load the sample).
- (Optional) Set a root element name if your schema has multiple global elements.
- Choose draft + options, then click Convert.
- Copy the JSON Schema output.
FAQ
Does this XSD to JSON Schema converter upload my schema?
No. The conversion runs locally in your browser and the script does not make network requests.
Which XSD features are supported?
Common patterns: global elements, complexType + sequence/all, simpleType restrictions (enums/pattern/length), attributes, and arrays via maxOccurs.
How are minOccurs/maxOccurs mapped?
minOccurs=0 makes the property optional; maxOccurs>1 or unbounded becomes a JSON Schema array with items.
How are XSD attributes represented?
They are added as object properties; by default the tool prefixes them with @ (toggle in options).
What if my XSD has multiple global elements?
Set the root element name. If you leave it blank, the converter uses the first global <element>.
Is the output a perfect 1:1 mapping to XSD validation rules?
No. XSD has constructs (e.g., some choice/extension cases) that don’t translate perfectly; this tool provides a practical best-effort JSON Schema.
Which JSON Schema draft should I choose?
Use 2020-12 unless you must match an older validator; Draft-07 is included for compatibility with legacy tooling.