How HTML5 Canvas 2D Fingerprinting Works
HTML5 Canvas fingerprinting exploits a routine graphics API that almost every modern web application relies on. A tracking script creates a hidden offscreen canvas element, draws a fixed combination of text, font styles, alpha gradients, and geometric curves, and then calls canvas.toDataURL() or ctx.getImageData() to read the rendered pixels back into JavaScript. Even when two devices run the same browser version on the same screen resolution, the resulting byte array rarely matches across different hardware and operating system stacks.
Those subtle pixel-level differences come from several layers working together: sub-pixel font hinting in DirectWrite on Windows, CoreText on macOS, or FreeType on Linux; GPU driver anti-aliasing shaders; color-profile conversion; and fallback emoji glyphs. Hashing the raw PNG bytes produces a compact identifier that survives clearing cookies, resetting localStorage, or switching IP addresses. You can inspect your own local Canvas render and hash directly on the McPriv Browser Fingerprint Test locally in your browser without uploading your render.
What Real Example Values Look Like
On default Chrome running on Windows 11 with a dedicated GPU, calling toDataURL() twice in the same tab returns identical SHA-256 hashes (for example 8f1d4a7c90b2e314) across every page load and across different websites that draw the same test string. In research by Laperdrix et al. (IEEE S&P 2016), Canvas 2D alone contributed roughly 5.7 bits of entropy on desktop browsers, and far less on uniform mobile devices such as iPhones that share identical Apple GPU and font stacks.
Importantly, identical hashes within a single browser session do not always mean your browser lacks protection. Brave uses session-seeded farbling: within one site and one session, Canvas readback returns the same slightly perturbed pixels so legitimate canvas apps (charts, editors, photo tools) keep working cleanly. When you open a new session or visit a different eTLD+1 site, Brave generates a new seed and the hash changes completely. That is why McPriv pairs single-visit inspection with a local return-visit check and also links closely to WebGL GPU fingerprinting.
How to Defend Against Canvas Fingerprinting Per Browser
Effective defense means either blending into a large uniform crowd or randomizing output per site and per session without creating detectable API inconsistencies. Stacking third-party Canvas spoofing extensions on top of Chrome frequently backfires because scripts can inspect Function.prototype.toString or draw known pixels to detect modified prototypes.
- Brave: Open brave://settings/shields and verify 'Block fingerprinting' is set to Standard (default) or Strict. Standard applies per-site, per-session farbling to Canvas and Audio while keeping web apps functional.
- Firefox: Open Settings -> Privacy & Security -> select Strict Enhanced Tracking Protection. For maximum uniformity, advanced users can test privacy.resistFingerprinting in about:config, which prompts before allowing raw canvas image extraction and replaces unread canvas data with a neutral placeholder.
- Safari (macOS and iOS): Open Safari Settings -> Privacy -> Advanced Tracking and Fingerprinting Protection and set it to All Browsing. Safari also benefits naturally from smaller hardware diversity on iOS and Apple Silicon devices.
- Chrome and Edge: Neither browser randomizes Canvas 2D readback by default. Rather than stacking multiple canvas-blocker extensions that trigger anti-fraud consistency checks, use Firefox or Brave for sensitive browsing sessions.
Practical Limitations and Trade-offs
Canvas blocking is not free of side effects. Returning blank white pixels breaks online image editors, PDF viewers, signature pads, CAPTCHA widgets, and interactive charts. Aggressive per-call randomization (where two calls milliseconds apart return different pixels) is trivially detected by anti-bot scripts as anomalous behavior, which can ironically make a browser stand out more than a standard unmodified profile.
In practice, per-site session randomization (Brave's model) or standardized rendering plus permission prompts (Firefox RFP) gives the best balance between privacy and web compatibility. Combine Canvas protection with restricted font visibility and clean links from the McPriv URL Cleaner so you do not leak cross-site identity through query parameters either.
How to Verify Canvas Protection in DevTools Across Two Sessions
To check whether your browser randomizes Canvas per session instead of returning static pixels forever, open our standalone Canvas 2D Fingerprint Test in a normal tab and note the 16-character pixel hash. Re-running the probe inside the same tab should keep the hash steady on Brave (by design) and on Chrome (deterministic). Next, close all browser windows completely, relaunch the browser, and revisit the same URL: Brave Shields and Firefox FPP rotate to a brand-new hash, while unprotected Chromium returns the exact same hash across restarts.