Load HTML Results via URL
Load Base64-encoded HTML or remote HTML files through result-page query parameters.
Compare HTML can open a comparison from base and contrast query parameters. Use a remote-source link when the documents are already hosted, or Base64 when the link should contain both inputs.
Build a result URL
URL loading happens on the HTML result page. It resolves both parameters, validates the resulting input, and runs the comparison automatically.
https://comparejson.com/tools/compare-html/result?base=...&contrast=...
Always percent-encode each complete value with encodeURIComponent. Unencoded & or # in a signed remote URL can break query parsing, and Base64 padding or + characters also need encoding.
const url = `https://comparejson.com/tools/compare-html/result?base=${encodeURIComponent(baseValue)}&contrast=${encodeURIComponent(contrastValue)}`;
Both parameters are required. Base64 mode stores the encoded HTML itself in the URL. Remote URL mode stores source addresses, and your browser requests those sources. Neither mode creates a server-side snapshot.
Load remote HTML files
Pass publicly accessible HTTP/HTTPS URLs to base and contrast, percent-encoding each source address:
https://comparejson.com/tools/compare-html/result?base=https%3A%2F%2Fcomparejson.com%2Fexample_data%2Fdemo.base.html&contrast=https%3A%2F%2Fcomparejson.com%2Fexample_data%2Fdemo.contrast.html
Your browser fetches both sources directly. They must be reachable without browser-inaccessible authentication and allow the request through CORS. GitHub Gist page URLs are resolved to their raw content.
The response should contain HTML, typically served as HTML or plain text. A successful download does not guarantee useful input: empty content fails validation. parse5 can recover malformed markup instead of rejecting it, so check the reconstructed result when content validity matters; this is not standards-conformance validation.
Embed HTML as Base64
Encode each HTML document as Base64, then apply encodeURIComponent to each encoded value. For example, these inputs:
<div><p>Base HTML content</p></div>
<div><p>Contrast HTML content</p></div>
produce this URL after Base64 and percent encoding:
https://comparejson.com/tools/compare-html/result?base=PGRpdj48cD5CYXNlIEhUTUwgY29udGVudDwvcD48L2Rpdj4%3D&contrast=PGRpdj48cD5Db250cmFzdCBIVE1MIGNvbnRlbnQ8L3A%2BPC9kaXY%2B
You can optionally use the external base-64.com encoder or your own local tooling. It is only an encoding aid, not a privacy safeguard: Base64 is reversible, and any content you enter on an external site is subject to that site’s practices.
This mode is self-contained, but large documents can create URLs that browsers, chat tools, or link shorteners cannot handle reliably.
Privacy and sharing
Base64-encoded data in a URL is sent with page requests and may be recorded in hosting service logs. Remote source addresses are also part of the URL, and importing from a URL sends a request to the source you specify. Do not place sensitive data in URLs.
For a short server-hosted snapshot instead, see Share HTML Results.