Canvas fingerprinting is a browser tracking technique that instructs the HTML5 canvas element to draw hidden text and shapes, reads back the resulting pixels and converts them into a stable identifier for the device. In privacy and online tracking, it is a form of stateless identification: nothing is stored on the device, so clearing cookies or opening a private window does not remove the signal.
The method works because identical drawing instructions produce slightly different pixels on different combinations of graphics hardware, drivers, operating system, fonts and browser version. Canvas output is rarely unique by itself, but it adds substantial entropy to a broader device fingerprint and is among the most widely deployed fingerprinting vectors on the web.
How canvas fingerprinting produces an identifier
A canvas fingerprint is produced by a short script that renders content off screen and hashes the pixel data. The visitor sees nothing, because the canvas is never attached to the visible page or is sized to zero.
- The script creates a canvas element through the Canvas 2D API or, in a related variant, a WebGL context.
- It draws a test pattern: a text string in several fonts, often including emoji, plus overlapping shapes, gradients, shadows and alpha blending.
- It reads the result with
toDataURL()orgetImageData(), which returns the encoded image or raw pixel values. - It computes a hash of the pixel data, typically 32 to 64 hexadecimal characters, and sends it to a server alongside other attributes.
The differences come from the rendering pipeline. Font rasterization, subpixel antialiasing, hinting rules, GPU-accelerated compositing, color management and floating-point rounding all vary between systems. Two laptops with the same browser can still produce different hashes if their graphics drivers or installed fonts differ.
The following table lists the main components of a typical test pattern and the system property each one exposes.
| Drawn element | System property exposed | Typical source of variation |
|---|---|---|
| Text in a fallback font | Installed fonts | Font substitution differs by operating system |
| Emoji characters | Emoji font version | Platform emoji sets change with updates |
| Antialiased curves | Rasterizer behavior | Subpixel rendering and hinting settings |
| Gradients and shadows | Graphics pipeline | GPU, driver and blending precision |
| Semi-transparent overlaps | Compositing math | Floating-point rounding differences |
Stability, uniqueness and entropy of canvas hashes
A tracking signal is useful only if it is both distinctive across users and stable over time for one user. Canvas hashes score reasonably on both, which explains their popularity, but neither property is absolute.
Uniqueness depends heavily on the population. On a fleet of identical corporate laptops, most canvas hashes collide. Across the general web, measurement studies have reported canvas output contributing roughly 5 to 10 bits of entropy, enough to split a population into hundreds of groups but rarely enough to single out an individual. Combined with other attributes, such as screen size, time zone, language and audio processing output, it helps form a fingerprint that may be unique for a large share of browsers.
Stability is limited by software change. Browser updates, driver updates and new font packages can alter the hash, so trackers commonly use fuzzy matching that links a new fingerprint to an older one when most other attributes still agree.
| Factor | Effect on uniqueness | Effect on stability |
|---|---|---|
| Diverse hardware population | Increases | Neutral |
| Standardized corporate devices | Decreases sharply | High |
| Frequent browser updates | Neutral | Decreases |
| Graphics driver changes | Neutral | Decreases |
| Mobile devices of one model | Decreases | Moderate |
Canvas fingerprinting compared with other tracking methods
Canvas fingerprinting is one input to device fingerprinting, not a complete tracking system on its own. Its defining characteristic is that it requires no storage on the device, which separates it from cookies, supercookies and advertising identifiers.
The comparison below places it among neighboring techniques in web tracking.
| Technique | Stores data on device | Survives cookie clearing | Main countermeasure |
|---|---|---|---|
| Canvas fingerprinting | No | Yes | Canvas randomization or blocking |
| HTTP cookies | Yes | No | Cookie deletion and partitioning |
| Supercookies | Yes, in unusual stores | Often | Storage partitioning |
| WebGL fingerprinting | No | Yes | Reporting generic GPU strings |
| Audio fingerprinting | No | Yes | Audio output noise |
| Advertising ID | Yes, at system level | Yes | Resetting or disabling the ID |
Because the identifier is recomputed on every visit, canvas fingerprinting also enables cross-site tracking when the same third-party script runs on many websites. That property makes it attractive to advertising networks and also to fraud detection and bot management services, which use it to recognize suspicious devices.
Defenses against canvas fingerprinting
Browsers and extensions defend against canvas fingerprinting with three broad strategies: blocking readback, adding noise and making outputs uniform. Each has a different cost in compatibility and protection.
| Approach | How it works | Main drawback |
|---|---|---|
| Permission prompt | Asks before returning canvas pixels | Users often approve without understanding |
| Randomized noise | Adds small per-session pixel changes | Noise can be averaged out by repeated reads |
| Uniform output | All users return the same image | Requires strict control of fonts and rendering |
| Script blocking | Blocks known fingerprinting domains | Misses first-party and unknown scripts |
Tor Browser follows the uniformity principle and returns a blank or standardized image unless the user grants permission. Firefox includes canvas protections in its Resist Fingerprinting mode and blocks known fingerprinting scripts through Enhanced Tracking Protection. Brave and Safari apply forms of randomization or simplification to reduce the value of canvas readback. Tracker blockers such as uBlock Origin and Privacy Badger complement these measures by blocking scripts from known tracking domains.
A frequent misconception is that a private browsing window prevents canvas fingerprinting. Private mode clears stored state, but the rendering stack stays the same, so the canvas hash normally stays the same as well.
Legal status and detection challenges
In the European Union, canvas fingerprinting falls under the same consent rule as cookies. Article 5(3) of the ePrivacy Directive covers access to information on terminal equipment regardless of the technology used, and European data protection authorities have confirmed that fingerprinting requires prior consent unless it is strictly necessary for a service the user requested. Under the GDPR, a fingerprint linked to a person is personal data.
Enforcement is difficult because the technique is hard to detect from the outside. Auditors typically instrument browsers to log calls to toDataURL() and getImageData() on canvases that are never displayed, then check whether the output leaves the page. Legitimate uses of canvas, such as image editors and charts, complicate this analysis, so context and data flow decide whether a call is fingerprinting.
The short version
Every computer draws pictures in a slightly different way, much like two printers that print the same photo with tiny differences in color. A website can quietly ask your browser to draw a small hidden picture and then look at the exact result.
That tiny difference works like a name tag. It does not need cookies and does not disappear when you clear your history. Privacy-focused browsers fight back by blurring or standardizing the picture so that many people look identical.
Where it makes a difference
A privacy auditor reviews a news website for a regulator and loads the homepage in an instrumented browser with all cookies refused. The log shows that a third-party analytics script draws an invisible 240 by 60 pixel canvas containing a pangram, two emoji and an overlapping colored arc, then calls toDataURL() and sends a 64-character hash to an external server.
The auditor repeats the visit in a fresh profile on the same laptop and receives the identical hash, which confirms that the script recognizes the device without stored data. Because no consent was collected, the finding is reported as fingerprinting without a legal basis. The publisher removes the script, and the follow-up audit shows no canvas readback before the consent banner is answered.