Favorite places of your favorite city
Home
Add to preferred sources on Google

XML to JSON

Convert an XML document into an ordered JSON tree. Its child arrays show where text, elements and other content appeared.

XML input

One UTF-8 XML 1.0 document up to 2 MiB. JSON output up to 12 MiB.

JSON output

XML and JSON are processed on your device. The converter does not upload documents or fetch external references.

Convert XML

  1. Paste one XML document or choose a UTF-8 file.
  2. Select Pretty or Compact and choose Convert.
  3. Review the JSON, then copy it or download the file.

Read the JSON tree

Each element has arrays for attributes, local namespace declarations and children. Repeated element names remain separate entries in source order.

Namespace URIs identify expanded names. The default namespace gives unprefixed elements a namespace, while ordinary unprefixed attributes stay unnamespaced.

XML values remain strings. The parser decodes predefined references and applies XML's line ending and attribute normalization.

Examples

The content A<b/> B becomes three entries in order: text, an empty element and text.

An attribute id with value 0007 stays the string 0007. Pretty adds layout whitespace to the JSON without changing the tree.

Supported input

Use one XML 1.0 document up to 2 MiB. The tool declines documents with a DOCTYPE and applies structure and output limits.

This format uses explicit arrays and names. A consumer that expects properties keyed by tag name needs a separate mapping.

Local conversion

The browser processes the document on your device. Namespace and other reference strings remain data, and the converter does not fetch them.

XML conversion questions

Yes. They appear in the children array at their original positions.

XML attribute and text values remain strings. A downstream consumer can apply its own type rules.

The JSON keeps parsed structure and values. XML quote styles, reference spellings and equivalent empty-tag syntax have no separate fields.

The converter only reads the pasted or selected local input. References in the XML stay as data.

Sources

These references describe the XML model used by the converter.

The JSON field names and representation are specific to this converter.

References reviewed November 18, 2026.

JSON to TypeScript

Infer a TypeScript type alias from a JSON sample, then review, copy or download the code.

Open tool — JSON to TypeScript

JSON to YAML

Convert JSON to YAML locally while preserving number text and quoted strings; copy or download the complete result.

Open tool — JSON to YAML

YAML to JSON

Convert one YAML document locally to JSON with exact number text and bounded aliases, then copy or download the complete result.

Open tool — YAML to JSON

YAML Formatter

Format YAML indentation and copy the checked result while retaining comments and source details.

Open tool — YAML Formatter

XML Formatter

Check namespace-aware XML 1.0, format or compact locally, and copy or download UTF-8 output.

Open tool — XML Formatter

JSON Formatter & Validator

Check JSON syntax, format or minify locally, and copy or download output while preserving original data tokens.

Open tool — JSON Formatter & Validator
View all tools in this category