Initialising Workbench...
Paste an XSD schema or DTD and instantly generate Java classes with JAXB annotations, enums, and Lombok support.
XSD / DTD Input
Java Output
Format: XSD
Generated from local input only. No data is uploaded.
Every tool runs entirely in your browser. Nothing you type is uploaded, stored, or logged on our servers.
The XML to Java Class Generator turns an XSD schema or DTD into ready-to-use Java classes. Paste a <xs:schema> document or a DOCTYPE definition and it walks every complex type, element, and attribute it declares — creating a separate class for each element structure it discovers, and a Java enum for every xs:enumeration restriction.
Choose an optional root class name and package, then toggle Lombok to generate @Data-annotated classes instead of manual getters and setters, or enable JAXB annotations so the output can be marshalled to and from XML directly with @XmlRootElement, @XmlElement, @XmlAttribute, and @XmlValue.
This XSD to Java generator is useful for quickly scaffolding JAXB-ready model classes from a schema you were handed — a SOAP/WSDL contract, a config schema, or a legacy DTD — without typing each class by hand. It runs entirely in your browser — no schema content is uploaded.
It converts both XSD (XML Schema Definition) documents and DTDs (Document Type Definitions). Paste either format and the tool auto-detects it, or force a specific parser from the Schema format dropdown.
Built-in XSD types are mapped to their closest Java equivalent — xs:string to String, xs:int to Integer, xs:decimal to BigDecimal, xs:dateTime to LocalDateTime, and so on. Named complexTypes become their own Java classes, and xs:enumeration restrictions become Java enums.
Element declarations like (title, author+, price?) become fields with the right List/optional shape based on the *, +, and ? occurrence indicators. Elements with only #PCDATA content become String fields (or their own class with a @XmlValue field if they also have ATTLIST attributes).
When enabled, generated classes get Jakarta XML Bind annotations (@XmlRootElement, @XmlAccessorType, @XmlElement, @XmlAttribute, @XmlValue, @XmlEnum/@XmlEnumValue) so they can be marshalled to and from XML directly with a JAXB implementation, matching the shape produced by tools like xjc.
Yes. Enable the Lombok toggle to generate @Data classes instead of manual getters/setters. XSD complexContent extensions are also mapped to real Java inheritance (extends), with @EqualsAndHashCode(callSuper = true) added automatically when Lombok is on.
No. Parsing and class generation run entirely in your browser — no schema content is sent to a server.