Does the converter keep attributes?
Yes. Attributes appear under the @attributes key in the resulting JSON.
XML → JSON Converter
Developers love this view because attributes, arrays, and deeply nested nodes are preserved as structured JSON. Export the payload and plug it directly into your API, automation, or database seed.
Drop XML here or click to upload.
Waiting for XML upload …
Selected file: None
JavaScript snippet
Reuse the same parsing logic. Here's the minimal snippet used in the converter:
import { parseStringPromise } from 'xml2js';
const xmlToJson = async (xmlString) => {
const json = await parseStringPromise(xmlString, { explicitArray: false });
return json;
};
FAQs
Yes. Attributes appear under the @attributes key in the resulting JSON.
Use the same code server-side (Node.js + xml2js) and stream the JSON to disk.
Because the converter runs client-side, you can inject extra logic before generating the blob.