Share Results via URL

Compare JSON 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 JSON 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://comparejson.com/result?base=...&contrast=...

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

Method 1: Base64 Encoded JSON

Encode each JSON value as a Base64 string and pass it directly in the URL.

https://comparejson.com/result?base=eyJiYXNlIjoiYmFzZSBiYXNlNjRTdHJpbmcifQ==&contrast=eyJjb250cmFzdCI6ImNvbnRyYXN0IGJhc2U2NFN0cmluZyJ9

This example uses the same Base64 payloads shown on the home page. You can encode your own JSON with base-64.com. This method is self-contained and works with any JSON that can be Base64 encoded. Keep in mind that very large JSON values can produce long URLs.

Method 2: Remote JSON URL

Pass publicly accessible URLs to the base and contrast parameters.

https://comparejson.com/result?base=https://comparejson.com/example_data/demo.base.json&contrast=https://comparejson.com/example_data/demo.contrast.json

When the result page loads, it fetches both URLs and compares the JSON content. This example uses the same demo files linked on the home page. This method keeps the URL short and is useful for sharing comparisons of files stored in version control or cloud storage.

Security and Privacy

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