Canvas fingerprinting is a method websites use to display graphics and text. Websites use JavaScript and the HTML5 Canvas feature to generate an image and turn its results into an identifying value. This information can help recognize a browser without storing cookies. However, they cannot confirm a person’s identity on every device or for every person.
How Canvas Fingerprinting Works
Websites use Canvas to generate images with JavaScript, allowing them to display charts, games, and more. However, different browser technologies produce different results in the rendered output.
Rendering a Test Pattern
The fingerprinting script creates a canvas, which is not visible to the users, and instructs a browser to produce a pattern. This pattern is complex and may contain text in various fonts and shapes, as well as gradients and colors. Even if browsers receive the same instructions, the graphical capabilities of each browser will make slightly different pixels in the final product. These differences may be visually subtle yet measurable.
Extracting and Hashing the Image
The script starts reading the output once the drawing process is completed. The Canvas API provides getImageData() to retrieve pixel values and the toDataURL() method to export an image representation.
The next step of the script is the application of a hash function and the creation of a compact canvas. Hashes that are identical mean that the rendering environments are similar and indicate that the images are different. Matching hashes may mean that browsers produce similar graphics. Different hashes show that the results have changed. However, a hash is not a unique device number and cannot confirm someone's identity.
Factors That Affect Canvas Output
Font availability, font rasterization technology, the anti-aliasing used, browser version, operating system, or the graphics driver versions can influence the canvas output.
Anti-aliasing is used for smoothing text and shape corners, and this can lead to the emergence of slightly different pixel values. Therefore, if the graphics driver or browser is updated, the stability of the fingerprint may be affected.
Research from Princeton University identifies font rendering and anti-aliasing as factors behind canvas-based differences.
Key Characteristics
Identification Without Cookies
Canvas fingerprinting is focused on measuring a reaction produced by the browser and doesn’t rely on obtaining stored cookies. Changing cookies or using incognito mode may not help invalidate the signal. The site has the ability to generate it again during a later visit, though the outcome can vary depending on the settings or privacy features.
Fingerprinting scripts also need a way to compare results across visits; the canvas hash alone does not automatically create a cross-site tracking record.
Stability and Repeatability
As long as the drawing information and graphical conditions are unchanged, repeated canvas measurements can lead to the same output. This makes the signal appropriate for comparison.
However, stability is not guaranteed; updates, font changes, settings for the hardware acceleration, or anti-fingerprinting technologies can change the returned image.
Likewise, two users with sufficiently similar configurations may produce identical results. Canvas data is therefore a probabilistic clue, not a permanent identifier.
Canvas vs. WebGL Fingerprinting
Canvas fingerprinting usually examines 2D drawing output, particularly text and pixel rendering. WebGL fingerprinting instead uses a graphics API designed for accelerated 2D and 3D rendering and may examine renderer characteristics, supported extensions, or rendered graphics.
The two methods can overlap because both interact with the graphics stack, but they measure different properties. A website may combine them with other browser fingerprinting signals rather than relying on either result alone.
Common Use Cases
Fraud Detection and Account Security
A service can compare canvas data with previous session information when assessing a login, registration, or transaction. For instance, a new fingerprint may affect risk scoring along with changes in other signals. It should not be considered proof of account theft, as software updates and privacy settings can also cause changes.
Bot Detection
Security systems could use rendering data among browser signals in order to determine automated traffic. For instance, abnormal uniformity of results across many sessions or inconsistency of rendering could be significant for further verification.
Advertising and Web Tracking
Tracking services can use canvas measurements to help associate visits without depending entirely on third-party cookies. A study conducted in 2014 provided evidence of canvas fingerprinting used on actual sites. This finding shows that the technique is used, but not how common it is today.
Linking visits across different websites still requires a party able to collect and compare their signals, and the practice raises privacy and transparency concerns.
Privacy Risks and Browser Protections
Canvas functionality is standard online functionality, so a page may run fingerprinting code without an obvious visual indicator. The W3C fingerprinting describes how browser characteristics may assist in identification and re-identification.
When canvas output is combined with language, time zone, screen properties, and other device signals. The collection does not reveal someone’s name, but may help to connect browsing actions over time.
Browser-Level Defenses
Privacy-oriented browsers can protect users from identification via canvas readings. Firefox describes protections that add noise during canvas readings. Brave explains randomization is based on sites and sessions, called farbling.
These approaches differ: some modify the data provided, while others prevent extraction or standardize the surrounding browser environment. Neither approach eliminates recognition through other signals.
Limitations and Considerations
Limited Uniqueness
Canvas hash can be the same across different devices. The same operating system, device, browser, font, and graphic settings will result in matching hash outputs. At the same time, the same device can produce different hashes after an update. Devices that rely on canvas hashes should be used in conjunction with other information and take into account false and missed matches.
Readback and Security Restrictions
Not all canvas pictures can be accessed. In case a canvas contains cross-origin image data without the required permission, it will be marked as tainted by the browser, which will block pixel extraction.
Compatibility and Privacy Trade-Offs
Aggressive blocking or alteration of canvas readback can affect legitimate features that export images, edit graphics, or inspect pixels. Privacy defenses therefore balance tracking resistance with website functionality. Developers using canvas signals for security should also consider user privacy and avoid treating a single changed value as decisive evidence of abuse.