Back to blog

What is Canvas fingerprinting? Why a canvas hash is not a device identity card

Canvas fingerprinting uses differences in browser rendering, but a hash is neither a device serial number nor independent proof of linked accounts. Understand drawing, pixel reading and comparison through a local example, and interpret repeat tests, export errors and privacy settings correctly.

Canvas fingerprinting usually asks a browser to draw specified text and shapes, reads the rendering and calculates or compares output features. It uses the environment's influence on drawing, rather than reading a fixed number called a Canvas ID from your computer.

When a test site shows a hash, ask what it drew, what it read and how it calculated it. Different programs producing different results do not necessarily mean the same browser changed.

From a canvas to a result: what happens?

Canvas is a normal web drawing capability used by charts, image editors, games and screenshot exports. The HTML Canvas standard defines contexts, image reading and export, not a tracking-only purpose.

A typical fingerprint test roughly follows these stages:

StageWhat the program doesWhat influences the result
Define the drawingSelect dimensions, font, text and shapesThe test script itself
Browser renderingTurn instructions into an imageBrowser, fonts and rendering environment
Read outputRead pixels or export an image representationReading method, browser policy and resources
Calculate and compareSummarize output or compare featuresAlgorithm and comparison sample

The final hash summarizes a particular output using a particular algorithm. A matching digest indicates matching corresponding output in that comparison; a different digest does not automatically identify the cause.

Why can similar-looking images have different data?

Visible text edges and gradients are only part of an image. Tiny pixel differences may be hard to see yet change the calculated digest.

Available fonts, browser version, drawing implementation and operating conditions can affect results. Changing text, colors, canvas dimensions or export method in the test can also create different data.

Keep the program and conditions fixed when comparing. Different outputs from two websites usually cannot prove whether a privacy setting worked.

A local-only example

This code creates and displays a small canvas on the current page and logs information to the developer console. It sends nothing to a server and implements no cross-site identification. Run it on a test page you control to understand the interfaces.

const canvas = document.createElement('canvas');
canvas.width = 240;
canvas.height = 60;
const context = canvas.getContext('2d');

if (context) {
  context.fillStyle = '#6f35c7';
  context.fillRect(0, 0, canvas.width, canvas.height);
  context.fillStyle = '#ffffff';
  context.font = '20px sans-serif';
  context.fillText('Canvas example', 12, 38);
  document.body.append(canvas);
  console.log(canvas.toDataURL('image/png').length);
}

The output length is not a unique device identifier. The example only demonstrates drawing and reading an image representation on one page. Studying repeatability requires controlled inputs, recorded conditions and a defined comparison method.

Can a Canvas hash prove two accounts belong to one person?

Not on its own. Different environments can produce the same output; one environment can change output through upgrades, settings or protection. Identification may combine other information.

EFF's fingerprinting explanation identifies persistence and distinguishing ability as important and notes that changing a single signal can create new observable differences. A matching result does not prove linkage, and a changed result does not prove anonymity.

A test site also lacks all the target platform's internal signals. It can inspect visible behavior, but cannot guarantee whether an account will be restricted.

Why does canvas export fail?

Ordinary image editing or chart export can fail too. External images that do not satisfy cross-origin reading requirements may trigger security restrictions on reading or export. That is not the same as detecting fingerprint protection.

Check the error type, resource origin and loading conditions, then check permissions or browser protection settings. Do not disable certificate verification, install unknown extensions or bypass access controls to make export succeed.

Large images also require attention to memory and export methods. A small teaching canvas does not mean a production image editor should always use the same string-export approach.

Run a meaningful repeat test

Save page version, drawing inputs, browser version and settings. Repeat in the same environment to check stability, then change just one factor.

For example, to examine an upgrade, keep the script and fonts fixed and record before-and-after results. Changing browser, proxy, fonts and testing site together prevents attribution to one factor.

If protection processes output by site or session, record that scope too. Interpret results under actual conditions rather than repeatedly randomizing settings merely to produce differences.

Balance privacy and normal functionality

Review built-in tracking protection and permissions, then check everyday charts, image uploads, editing and export. A page should not be considered maliciously tracking users merely because it calls Canvas.

For extensions, inspect source, permissions and maintenance. Overlapping modifications can make results less explainable and break pages. Aim to reduce unwanted linkage and exposure, not force every test to show the same label.

What to record across browser environments

Teams managing authorized accounts or reproducing problems can keep browser version, Canvas settings, environment purpose and test records together. PurpleMark provides relevant browser parameter settings for saving and reviewing business configurations.

Before comparing environments, align test conditions and interpret differences; do not approve an environment from a Canvas value alone. To connect accounts, proxies and member responsibilities, manage business groups in the PurpleMark web app.

Canvas fingerprints are only part of browser information. Understanding them means separating normal drawing, test output and identity inference to make explainable privacy and compatibility decisions.