XML to JSON and JSON to XML Converter

Convert XML to JSON and back with configurable attribute prefix, text key, array handling and indentation. All conversion happens locally.

XML

JSON

Conversion runs in your browser. XML and JSON content is never uploaded.

About This Tool

The XML and JSON converter moves data between the two formats that still dominate integrations. Older SOAP services, payment gateways and enterprise systems return XML, while modern frontends and APIs work with JSON. Instead of writing a throwaway script, paste the document and get the other representation immediately.

Attributes and text nodes need conventions, so the tool exposes them directly: choose the attribute prefix, the key used for text content, whether single elements should still be arrays, and the indentation. Conversion happens entirely in the browser, which matters when the payload contains internal endpoints or customer data.

Key Features

Two-way conversion

XML to JSON and JSON to XML on one page with a tab switch.

Attribute conventions

Set the attribute prefix such as @ or @_, and the key used for text nodes.

Array control

Optionally wrap every element in an array so consumers always see a consistent shape.

Readable output

Choose zero, two or four spaces of indentation for both directions.

When to Use It

Legacy API integration

Inspect an XML response from an older service in the JSON shape your code expects.

Build a JSON fixture

Convert a sample XML payload into JSON for mocks and unit tests.

Generate test XML

Turn a JSON fixture back into XML to exercise a SOAP endpoint or file import.

How to Use It

  1. 1Choose XML to JSON or JSON to XML.
  2. 2Paste the source document.
  3. 3Adjust attribute prefix, text key, array handling and indentation.
  4. 4Convert, then copy the result.

Frequently Asked Questions

Why do attributes appear as @id?

The prefix marks keys that become XML attributes. Change the prefix if your downstream tool expects a different convention such as @_ or _attributes.

Is anything uploaded?

No. Both directions run as local text processing inside the browser.

CodeSwordsman

100+ technical tools with browser-local processing — your data never leaves your device. Official Microsoft Store desktop apps: free, ad-free, offline.

Completely Free

© 2026 CodeSwordsman All Rights Reserved

Service Terms | Privacy Policy | Help | Version Updates | About Us

This website uses cookies to ensure you get the best experience on our website. Privacy Policy.