XML Toolkit

Format XML, validate parser errors, and convert XML documents to JSON without uploading payloads.

Local processingYour input stays in this browser tab.
Formatting

Format & compact

Beautify nested XML, minify whitespace, and control indentation before comparing payloads.

Transform

Convert

Switch between XML and JSON locally. Output highlighting follows the selected conversion.

Inspect

Query

Run XPath against the input document and send matched nodes to the output panel.

Workspace

Session

Load a safe sample, clear the workspace, or export the current output.

Input

Paste or type XML to format or convert

0 charactersLine 1, Col 1

Output

Formatted XML or converted JSON

Validation: WaitingCtrl/⌘ Enter formats · Shift converts
Line 1, Col 1File size: 0 bytesValidation: WaitingOutput: XML
Browser-local reference

User guide

Use the guide as a quick checklist when formatting, converting, or debugging XML payloads.

1. Paste input

Paste XML for formatting, minification, XPath, or XML to JSON. Paste JSON when using JSON to XML.

2. Format or minify

Format XML adds readable indentation. Minify XML removes formatting whitespace for compact transport.

3. XML to JSON mapping

Attributes become @ properties, text nodes are preserved, and repeated sibling tags become arrays.

4. Query with XPath

Try //ship for elements or //@id for attributes. Matching nodes render in the output editor.

5. Fix issues

Malformed XML appears in the Issues pane. Use Go to error to focus the exact line and column in the input editor.

How to use the XML Toolkit

Paste XML into the input panel, then choose Format XML for two-space indentation or Convert to JSON for a structured JavaScript object representation.

The output editor switches syntax mode between XML and JSON depending on the action so folding, bracket matching, and highlighting stay useful.

XML to JSON mapping rules

  • Attributes become properties prefixed with @, such as @id.
  • Text content is preserved as #text when an element also has attributes or child elements.
  • Repeated child tags become arrays automatically.
  • Malformed XML is reported from the browser's native DOMParser parser error.

Client-side parsing

The toolkit uses new DOMParser().parseFromString(input, "application/xml") in the browser. PayloadHarbor does not send XML or converted JSON to a server.