XML to JavaScript POJO Generator
Turn XML samples into JavaScript ES6 classes with fromJSON and toJSON in the browser.
XML to JavaScript POJO Generator
Paste XML and get plain JavaScript classes with a constructor, static fromJSON, and toJSON methods.
Parsing uses fast-xml-parser style semantics (attributes with @_ prefix, text nodes as #text) so generated field names stay readable.
How it works
The tool infers nested objects and arrays from your XML tree, emits one class per object shape, and exports them with module.exports for Node-style bundles.
Adjust the root class name to match your domain (for example Bookstore for a bookstore sample).
Frequently Asked Questions
Does this run on the server?
No. All parsing and code generation happen in your browser; nothing is uploaded.
Why do I see #text keys in toJSON?
Those mirror the parser’s keys so round-tripping matches the parsed object. Property names on the class use a cleaned camelCase form where possible.
Can I use the output in the browser without Node?
Replace module.exports = { ... } with export { ... } or attach classes to window depending on your bundler or script setup.
Related tools
Your recent visits