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 or a link to it, not a server-side snapshot.
Method 1: Load JSON from File 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 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 JSON from Base64
Encode each JSON value as a Base64 string and pass it directly in the URL.
{
"message": "base base64String"
}
{
"message": "contrast base64String"
}
The Base64-encoded values produce this shareable URL:
https://comparejson.com/result?base=eyJtZXNzYWdlIjoiYmFzZSBiYXNlNjRTdHJpbmcifQ==&contrast=eyJtZXNzYWdlIjoiY29udHJhc3QgYmFzZTY0U3RyaW5nIn0=
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.
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.