Dev · 108 tools · nothing uploads

XML ↔ JSON

Convert between XML and JSON. Attributes round-trip as "@_name" keys; values are kept as text, never reparsed as numbers or booleans. Runs on your device.

Input

Options

live

XML <-> JSON turns an XML document into JSON, carrying attributes as @_name keys and mixed element text as #text. Values stay plain text, never reparsed as a number or boolean. A single top-level key becomes the XML root when converting back; more than one gets bundled under rootName, default root. Malformed XML is refused, naming the line and column.

Questions

How are XML attributes represented in JSON?

As @_name keys alongside the element's own children.

How is element text represented?

As a #text key when an element mixes text with attributes or child elements.

Are values reparsed as numbers or booleans?

No, every value is kept as plain text, so a numeric-looking or 007-style value round-trips unchanged.

What controls the XML root when converting back?

A JSON object with exactly one top-level key uses that key as the root as-is; anything else is wrapped under rootName, default root.

What if my XML is invalid?

The tool refuses with the exact line and column XMLValidator reports.

Related Dev tools

n→nCBOR to JSON converterEncode JSON to CBOR bytes (shown as hex) or decode CBOR bytes back to JSON. Covers uint/negint/text/array/map/float/bool/null; no byte strings, tags, or indefinite-length items.Runs on each file you dropn→nJSON ↔ MessagePackEncode JSON to MessagePack bytes (shown as hex) or decode MessagePack bytes back to JSON. Covers nil/bool/int/float64/str/array/map: no bin, ext, or timestamp extension types.Runs on each file you dropn→nJSON ↔ RisonConvert JSON to Rison (the compact URI-safe notation Kibana/Elasticsearch use for query params) and back. This tool's own encoder/decoder for the documented core grammar (no reference implementation in this codebase to check against). Exotic edge cases like embedded control characters or surrogate-pair characters are not guaranteed byte-identical to the reference grammar.Runs on each file you dropn→nPHP serialize / unserializeConvert JSON to PHP's serialize() format and back. Covers null/bool/int/float/string/array. PHP objects (O:) are not implemented since they need a class registry this tool doesn't have.Runs on each file you dropn→nPLIST viewerView an XML property list (.plist) as JSON. Binary plist (bplist00) is not supported. It needs a separate binary-format parser this tool does not implement.Runs on each file you dropn→nGeoJSON ↔ CSVConvert GeoJSON Point features to CSV rows and back. LineString/Polygon geometries export as a flattened coordinate list (one-way; CSV->GeoJSON always builds Points). CSV parsing is fully quote-aware, so a quoted field holding a comma or a newline no longer shifts the coordinate columns.Runs on each file you dropn→nKML/GPX to GeoJSONConvert a GPX (waypoints/tracks/routes) or KML (Placemarks: Point/LineString/Polygon) file to GeoJSON. A hand-rolled tag scan, not a general XML parser: no styles, nested Folder hierarchy, MultiGeometry, or extended data.Runs on each file you drop·→1Coordinate format convert (DD/DMS/UTM)Convert between decimal degrees, degrees-minutes-seconds, and UTM. WGS84, standard 6° zones, non-polar only. MGRS grid-square lettering is not implemented (its edge cases are a separate, riskier piece of work).Takes no file