devShakib

Loading devShakib…

JSON / XML

Convert a JSON object to XML and back. Free, runs entirely in your browser — no signup, and nothing you paste in is uploaded.

The two formats disagree about what a document is. JSON has arrays, numbers, booleans and null as distinct types; XML has elements, attributes and text, and everything is a string until a schema says otherwise. Converting between them therefore cannot be lossless in both directions without a convention.

The one that bites is repetition. JSON says a list is a list; XML says the same element appeared three times. A converter reading XML back cannot tell a one-element list from a single value without knowing the schema, which is why round-tripping through XML can quietly turn `[x]` into `x`.