The HTML diff tool parses two HTML documents using the browser's built-in DOMParser and compares them at the element level — detecting added tags, removed tags, changed attributes, and text content modifications. Unlike plain text diff tools, HTML diff understands document structure so reformatted but identical code won't produce false positives.