XML ↔ JSON Converter

XML Input

JSON Output

Ready

Conversion History

No history yet

Compare Original vs Converted

Original

Converted

Bulk Conversion

Drag & drop files here or click to select

Supports .xml and .json files

API Endpoint

REST API Endpoint

POST /api/convert
Request Body:
{
  "direction": "xml-to-json" | "json-to-xml",
  "data": "your content here",
  "options": {
    "rootElement": "root",
    "indentation": 2,
    "preserveAttributes": true,
    "detectArrays": true,
    "prettyPrint": true
  }
}
Response:
{
  "success": true,
  "result": "converted content",
  "error": null
}

Note: This is a client-side tool. For server-side API, deploy this as a Node.js service with Express.js.

Command-Line Interface

Installation

npm install -g xml-json-converter

XML to JSON

xml-json-converter xml-to-json input.xml -o output.json

JSON to XML

xml-json-converter json-to-xml input.json -o output.xml --root root

Options

--indent 2 Set indentation spaces --no-attributes Don't preserve attributes --no-arrays Don't detect arrays --minify Minify output --pretty Pretty print (default)

Note: CLI tool requires separate installation. This is the web interface version.

Custom Conversion Rules

Define element name transformations during conversion.