Share Results via URL

Compare XML can encode comparison inputs into URL query parameters, so you can share a diff with teammates or link to it from documentation without sending the XML through a server.

How URL Sharing Works

All sharing happens through the /result page. The page reads the base and contrast query parameters, decodes them, and runs the comparison automatically.

https://comparexml.com/result?base=...&contrast=...

Because the comparison runs in the browser, the shared URL contains the raw data or a link to it, not a server-side snapshot.

Method 1: Load XML from File URL

Pass publicly accessible URLs to the base and contrast parameters.

https://comparexml.com/result?base=https://comparexml.com/example_data/demo.base.xml&contrast=https://comparexml.com/example_data/demo.contrast.xml

When the result page loads, it fetches both URLs and compares the XML content automatically. This method keeps the URL short and is useful for sharing comparisons of files stored in version control or cloud storage.

Method 2: Load XML from Base64

Encode each XML document as a Base64 string and pass it directly in the URL.

<root>
  <base>base base64String</base>
</root>
<root>
  <contrast>contrast base64String</contrast>
</root>

The Base64-encoded values produce this shareable URL:

https://comparexml.com/result?base=PHJvb3Q+PGJhc2U+YmFzZSBiYXNlNjRTdHJpbmc8L2Jhc2U+PC9yb290Pg==&contrast=PHJvb3Q+PGNvbnRyYXN0PmNvbnRyYXN0IGJhc2U2NFN0cmluZzwvY29udHJhc3Q+PC9yb290Pg==

You can encode your own XML with base-64.com. This method is self-contained and works with any XML that can be Base64 encoded. Keep in mind that very large XML values can produce long URLs.

Security and Privacy

  • Shared URLs contain the XML data or links to it. Share them only with people who should have access.
  • Remote XML files must be publicly accessible and served with appropriate CORS headers.
  • Compare XML does not store comparison inputs on a server. The URL is the only transport mechanism.