SVG Diff Checker
Spot every difference between two SVG files side by side.
SVG comparison
Compare two SVG files — spot every structural difference at a glance.
Paste two SVG files, upload from disk or try the built-in sample. SVG Diff Checker compares dimensions, viewBox, colors, and element counts entirely in your browser. Your SVG files are never uploaded.
Please check the SVG markup and try again.
SVG A vs SVG B
Paste SVG A markup to preview it here.
Paste SVG B markup to preview it here.
Comparison Summary
Comparison Report
How It Works
SVG Diff Checker reads both SVG files entirely in your browser using the DOMParser API — no data is ever uploaded. It extracts and compares four categories of information: metadata attributes (width, height, viewBox and preserveAspectRatio), element counts per tag type (path, circle, rect, g and 14 other element types), the set of unique colors derived from fill, stroke, stop-color and inline style declarations, and raw file size in bytes. Differences are shown in a summary card, five detailed diff cards and a copy-able plain-text report. The tool performs a structural diff only — it does not render either SVG to a canvas or compare pixel output, which means comparisons are fast and deterministic regardless of rendering environment.
Use Cases
- Verifying that an automated SVG optimization pipeline produced the expected structural output by comparing the original and optimized files side by side
- Auditing two versions of an icon to confirm that only the intended color tokens changed and that no element counts or dimensions were accidentally altered
- Reviewing a designer handoff by comparing the exported SVG against the version already in the codebase to identify any new elements, viewBox shifts or palette additions before merging
- Detecting unintended regressions in a build script that transforms SVGs by comparing a known-good reference file against the latest build output
- Checking whether two SVG files from different sources are structurally equivalent — same viewBox, same color set, same element structure — before deciding whether to consolidate them
FAQ
Does SVG Diff Checker upload my files?
No. SVGTrim compares SVG files locally in your browser. Your SVG files are never uploaded and all analysis is performed on your device. The DOMParser API processes the markup in memory, no network request is made for either SVG file, and the comparison output is generated entirely client-side.
What kind of diff does SVG Diff Checker perform?
SVG Diff Checker performs a structural diff — it compares SVG metadata attributes, element counts per tag type, unique color sets and file size. It does not perform pixel-level or canvas-render comparison. This means the diff is fast, deterministic and works in any browser environment without requiring canvas access.
Will SVG Diff Checker tell me which exact elements changed?
SVG Diff Checker reports per-tag element count differences — for example, showing that SVG A has 3 circle elements and SVG B has 4. It does not perform a full tree diff to identify which specific element node was added or modified. For a full DOM-level diff you would need to compare the raw SVG markup in a text diff tool.
How are colors extracted and compared?
Colors are extracted from fill, stroke, stop-color, flood-color, lighting-color and color presentation attributes as well as inline style declarations on every element. Each raw color value is normalized to a canonical hex form — short hex (#rgb) and named colors like 'red' are expanded to #rrggbb. The set of unique canonical colors from each SVG is then compared to find colors added in SVG B, colors removed from SVG A and colors shared by both files.
What happens if one of the SVGs is invalid?
If either input contains markup that cannot be parsed as valid SVG — for example if the root element is not svg, or if the XML is malformed — SVG Diff Checker shows an error message and stops. The error card describes which file failed to parse so you can correct the markup and try again.
Can I compare two SVGs that have the same visual appearance but different markup?
Yes. SVG Diff Checker compares structure, not rendered output. Two SVGs that look identical on screen may still differ in their viewBox, element count, color declarations or file size, and those differences will be reported. Conversely, two SVGs that render identically but use equivalent alternate forms — for example #f00 and red for the same red — will show no color difference because both normalize to #ff0000.
Is there a file size limit?
SVG Diff Checker accepts SVG files up to 5 MB per file. Files larger than 5 MB are rejected with an error message. For typical SVG icons and illustrations this limit is never reached — a 5 MB SVG file would be extremely large for a vector graphic.