WebToolsForAll

Tools / Data Converters

XML to ordered JSON tree

Inspect XML as an explicitly ordered JSON node tree.

Input

0 UTF-16 code units

Optional local draft

Saving stores a plaintext draft in this browser on this device. Do not save secrets or use this on a shared device. Nothing is saved or loaded automatically. Reset does not delete a saved draft; use Delete local draft.

No draft has been loaded.

Import a local text file

Output

Work through the task

Represent XML as an ordered JSON node tree.

  1. Enter XML with one root, then convert to the documented tree mapping.
  2. Read element names, ordered attributes and ordered child nodes. This is a node representation, not an application-specific flat-object mapping.
  3. Review the result before copying or downloading. Editing an input invalidates the previous result; keep an original if the transformation matters.

Example to check

<r a="007">A &amp; B</r> produces an r element with attribute a="007" and a text child containing A & B.

Limits and output behavior

Source is limited to 100,000 characters. JSON/YAML/TOML have 10,000 values and 40 data levels; XML has separate node/attribute and element-depth guards. Comments, numeric spelling and other lexical formatting may normalize. YAML aliases/custom tags and TOML null values are unsupported. DTD/custom entities and external resources are rejected. This is not XSD, SOAP or application-schema validation.

Troubleshooting

Use one root element and declared namespace prefixes. Fix mismatched tags; DTDs, custom entities and external resources are rejected.

Questions

Why is the result an ordered node tree instead of a flat object?

The mapping retains element/attribute names, child order, mixed text and other supported nodes. It does not guess an application-specific object mapping.

Input and privacy

Processing runs in this browser. Inputs are not saved automatically. An explicitly chosen local draft, where offered, is plaintext storage on this device. Downloaded files, clipboard contents and browser extensions have separate retention behavior.