XML to JSON (Free Online Tool)
Parse XML text into JSON for downstream normalization, validation, and reconciliation pipelines
Paste your JSON → Get results instantly (no signup)
→ Parse a bank statement XML into JSON for downstream reconciliation.
1{2 "BankStatement": {3 "Account": {4 "IBAN": "DE89370400440532013000",5 "Currency": "EUR"6 },7 "Statement": {8 "@startDate": "2026-05-01",9 "@endDate": "2026-05-31",10 "Balance": [11 {12 "@type": "opening",13 "@amount": 100014 },15 {16 "@type": "closing",17 "@amount": 1450.518 }19 ],20 "Transaction": [21 {22 "Date": "2026-05-15",23 "Amount": {24 "@currency": "EUR",25 "#text": 50026 },27 "Description": "Salary payment",28 "Reference": "SAL-2026-05"29 },30 {31 "Date": "2026-05-20",32 "Amount": {33 "@currency": "EUR",34 "#text": -49.535 },36 "Description": "Grocery store"37 }38 ]39 }40 }41}Love the result?
Use this exact pipeline in your app, backend, or LLM workflow.
No setup needed. Works with curl, Node, Python.
Uses example data. For edited input, copy from the playground.
Works with:
- API responses
- Nested JSON
- Arrays & objects
Example: input → output
Related tools
- CSV to JSONParse CSV text into a JSON array of row objects for further cleanup or reshaping
- YAML to JSONParse YAML into JSON for diff, validation, and config-normalization pipelines
- Table JSON to RecordsConvert table-like JSON exports with header and row arrays into normal JSON records
- JSON to CSVConvert JSON array row data into final CSV text output
- Format ValuesReformat individual values with case changes, trimming, coercion, and slugification
Advanced usage (optional)
XML to JSON
v1.0.0Description
XML to JSON
Parse XML text into JSON. Designed as an ingress adapter for the ForgeJSON pipeline — once XML is JSON, every downstream utility (pick fields, validate schema, normalize, diff, redact) operates on it natively. Runs locally in your browser; no upload.
How It Works
Pastes raw XML in, gets a JSON tree out. Attributes become @attrName keys on the element. Numeric and boolean text content is coerced to native JSON types. Multi-child siblings with the same tag name are grouped into arrays.
This utility intentionally ships parse-only. It is not an XML platform: no XPath selectors, no XSD validation, no JSON-to-XML round-trip. The pipeline does the work after parsing.
Configuration
| Field | Type | Default | Description |
|---|---|---|---|
| Preserve Attributes | boolean | true | Keep XML attributes as @attrName keys in the JSON output |
| Coerce Values | boolean | true | Convert numeric and boolean text into native JSON types |
| Array Mode | enum | auto | auto = multi-child siblings become arrays. always = force every non-root element into an array (handy when downstream pipelines expect transactions[] even for one-transaction accounts) |
Use Cases
Banking & Fintech
- ISO 20022 / camt.053 statements: Parse SEPA / SWIFT statement XML into a JSON tree, then pick fields, normalize dates and amounts, and validate the downstream contract
- Payment gateway reports: Adyen, Worldpay, and legacy gateway XML reports
- Reconciliation feeds: Normalize multi-source XML into a comparable JSON shape for diff workflows
Enterprise Integration
- SOAP responses: Strip SOAP envelopes, keep the payload as JSON for modern APIs
- Legacy ERP / CRM exports: Convert XML-based exports into JSON for downstream warehouses, analytics, and AI tooling
- EDI-adjacent formats: When EDI documents are XML-wrapped, this is the entry point
Common Pipeline Patterns
XML string
→ convert.xml-to-json
→ structure.pick-fields (extract canonical shape)
→ convert.format-values (coerce amounts to numbers, dates to ISO 8601)
→ validation.schema (assert downstream contract)Notes on XML Array Ambiguity
XML's notorious singular-vs-array ambiguity ( parses as txn: {} instead of txn: [{}]) makes downstream pipelines brittle. Use arrayMode: always when you want force-array behavior on every non-root element. A future release may add path-targeted force-array configuration for finer control.
Configuration
| Name | Type | Default | Description |
|---|---|---|---|
| Preserve Attributes | boolean | true | Keep XML attributes as `@attrName` keys in the JSON output (disable to drop them entirely) |
| Array Mode | enum | auto | auto: multi-child siblings become arrays, single children stay as objects. always: force every non-root element into an array — useful when downstream pipelines expect transactions[] even for accounts with one transaction. auto always |
| Coerce Values | boolean | true | Convert numeric and boolean text into native JSON types (disable to keep all values as strings) |
Examples
Parse a bank statement XML into JSON for downstream reconciliation.1{2 "BankStatement": {3 "Account": {4 "IBAN": "DE89370400440532013000",5 "Currency": "EUR"6 },7 "Statement": {8 "@startDate": "2026-05-01",9 "@endDate": "2026-05-31",10 "Balance": [11 {12 "@type": "opening",13 "@amount": 100014 },15 {16 "@type": "closing",17 "@amount": 1450.518 }19 ],20 "Transaction": [21 {22 "Date": "2026-05-15",23 "Amount": {24 "@currency": "EUR",25 "#text": 50026 },27 "Description": "Salary payment",28 "Reference": "SAL-2026-05"29 },30 {31 "Date": "2026-05-20",32 "Amount": {33 "@currency": "EUR",34 "#text": -49.535 },36 "Description": "Grocery store"37 }38 ]39 }40 }41}API Usage
curl -X POST https://your-domain.com/api/v1/utilities/convert.xml-to-json \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"inputs":{"primary":"<BankStatement>\n <Account>\n <IBAN>DE89370400440532013000</IBAN>\n <Currency>EUR</Currency>\n </Account>\n <Statement startDate=\"2026-05-01\" endDate=\"2026-05-31\">\n <Balance type=\"opening\" amount=\"1000.00\"/>\n <Balance type=\"closing\" amount=\"1450.50\"/>\n <Transaction>\n <Date>2026-05-15</Date>\n <Amount currency=\"EUR\">500.00</Amount>\n <Description>Salary payment</Description>\n <Reference>SAL-2026-05</Reference>\n </Transaction>\n <Transaction>\n <Date>2026-05-20</Date>\n <Amount currency=\"EUR\">-49.50</Amount>\n <Description>Grocery store</Description>\n </Transaction>\n </Statement>\n</BankStatement>\n"},"config":{"preserveAttributes":true,"parseValues":true,"arrayMode":"auto"}}'1{2 "BankStatement": {3 "Account": {4 "IBAN": "DE89370400440532013000",5 "Currency": "EUR"6 },7 "Statement": {8 "@startDate": "2026-05-01",9 "@endDate": "2026-05-31",10 "Balance": [11 {12 "@type": "opening",13 "@amount": 100014 },15 {16 "@type": "closing",17 "@amount": 1450.518 }19 ],20 "Transaction": [21 {22 "Date": "2026-05-15",23 "Amount": {24 "@currency": "EUR",25 "#text": 50026 },27 "Description": "Salary payment",28 "Reference": "SAL-2026-05"29 },30 {31 "Date": "2026-05-20",32 "Amount": {33 "@currency": "EUR",34 "#text": -49.535 },36 "Description": "Grocery store"37 }38 ]39 }40 }41}