Compare Two HTML Documents with Structural Context
A semantic HTML diff tool that understands DOM structure — not just text. Review element, attribute, text, comment, and doctype changes with path context.
HTML Documentation
Find task-based guides for comparing HTML, loading and sharing results, offline review, and automation.
Start with HTML comparison
Learn the basic workflow and the fixed rules behind HTML Data Compare.
Load & share comparisons
Build result URLs and create share links, with encoding and privacy details.
Offline & original-text review
Install the shared PWA for offline access or inspect original markup in Git Diff.
Automate HTML comparison
Run comparisons through agent skills or the Model Context Protocol.
Semantic HTML diff vs. text diff
Data Compare examines the parsed tree; Git Diff remains available when the original source text matters.
Ignore source-only layout changes
Attribute order and line breaks around a tag do not change the parsed element. These buttons compare as equal in Data Compare.
<button class="primary" type="submit">Pay</button>
<button type="submit" class="primary" >Pay</button>
Keep meaningful content changes
Comments and text are compared, and numeric-looking strings stay text. Both examples below contain real semantic edits.
<!-- deployed --> <p>Price: 1.0</p>
<!-- proposed --> <p>Price: 1</p>
Whitespace-only nodes between elements are ignored, but whitespace within meaningful non-empty text is not generally normalized. Results are reconstructed from parsed nodes rather than mapped back to exact source lines.
Need reorder, doctype, and parser-recovery details? Read the HTML comparison rules
Need to inspect the original HTML text line by line? Read the HTML Git Diff view guide
HTML comparison rules
The tool uses fixed structural rules—there are no child-matching methods or normalization settings to configure.
Use Cases
Review real markup changes in rendering, testing, communication, and monitoring workflows.
SSR & Template Revisions
Compare deployed and newly rendered pages after a template refactor. Separate attribute and text edits from added or removed regions before release.
Component Fixtures
Review saved HTML renders from component tests or Storybook-style fixtures. Inspect structural changes while keeping the original text available in Git Diff.
Email HTML
Check revisions to transactional or marketing email markup. Verify links, attributes, nested tables, and content without assuming parse5 recovery proves email-client compatibility.
Scraping & Page Monitoring
Compare two fetched or saved snapshots to investigate changed markup. Account for parser recovery and meaningful text whitespace when reviewing dynamic page output.