How to Check Canvas Fingerprinting Before Sites Block You

Canvas fingerprinting draws text and shapes into an invisible canvas, reads the pixels back, and hashes the result. Your GPU, your graphics driver and the way your operating system rasterises fonts all nudge those pixels, so the hash comes out slightly different from machine to machine. Two things are worth checking, and neither is the value itself: whether your hash stays the same across reloads, and whether it agrees with everything else your browser claims about itself. A hash that changes every load is louder than a boring one.
What you need
- A browser you can open devtools in, ideally the exact build your automation drives rather than your daily browser.
- A second reference point to compare against, such as an ordinary desktop profile on the same machine.
- CapSkip running, in Local mode on the loopback address or in Server mode on a box your workers can reach. Both are covered under connection settings, and it matters here only because the challenges you still get have to go somewhere.
What canvas fingerprinting actually measures
The technique is simple enough to fit in a paragraph. A script creates a canvas element, writes a short string in a named font, fills a couple of shapes, then calls a readback method. Mozilla documents the readback plainly: toDataURL returns a data URL containing the whole image as base64. Hash that string and you have a number that identifies the rendering stack that produced it.
What varies between machines is smaller than people expect. Anti-aliasing decisions on curved glyph edges, sub-pixel positioning, whether a requested font exists locally or was substituted, and the exact rounding your GPU driver does when it blends two colours. None of that is under your control from JavaScript, which is exactly why detection vendors like it.
What follows from that is the part worth acting on. Real hardware produces the same hash every single time. Popular hardware produces a hash that thousands of other people also produce. So the goal is not a rare fingerprint or a hidden one, it is a common and boringly stable one.
Step 1: read your own canvas hash
Paste this into the console of the browser you want to measure. It draws the same shapes a real fingerprinting script would and reduces the readback to something you can eyeball.
// no install needed, paste into the devtools console
function canvasHash() {
const c = document.createElement('canvas');
const ctx = c.getContext('2d');
ctx.textBaseline = 'top';
ctx.font = '16px Arial';
ctx.fillStyle = '#f60';
ctx.fillRect(0, 0, 120, 30);
ctx.fillStyle = '#069';
ctx.fillText('probe', 4, 20);
const url = c.toDataURL();
let h = 0;
for (let i = 0; i < url.length; i++) h = (h * 31 + url.charCodeAt(i)) | 0;
return h.toString(16);
}
canvasHash();The value itself tells you nothing on its own. There is no good hash and no bad hash, and no public list to check yours against. It becomes information only when you compare it with another run, or with another browser on the same machine.
Step 2: check whether the hash is stable
Run the probe several times in a row. On an unmodified browser every run returns the same value, because nothing in that drawing operation is random.
// run this after the function above is defined const runs = new Set(); for (let i = 0; i < 5; i++) runs.add(canvasHash()); // 1 means stable. Anything higher means noise is being added. console.log(runs.size, [...runs]);
If you get more than one value, something is injecting noise into the pixels. That is not necessarily your doing. Browsers ship this behaviour themselves now, and Mozilla documents it on the pixel readback method: with fingerprinting protection enabled, random subtle noise is introduced to the getImageData result so a site cannot infer the rendering device, which also means the write and read round trip no longer matches.
So an unstable hash has two possible sources, and you need to know which one you are looking at. A privacy browser doing it on purpose is one story. A stealth patch you installed in your automation stack is a different story, and it is the one that hurts.
Step 3: check it agrees with everything else you claim
A fingerprint is judged as a set, not as individual values. Detection code compares the canvas result against the other things the browser says about itself, and contradictions score worse than any single unusual value.
| Signal | What a consistent story looks like | Common contradiction |
|---|---|---|
| Canvas hash | Stable across reloads, matching the platform it claims | New value on every read |
| WebGL renderer string | A named consumer GPU | A software renderer under a desktop user agent |
| Font substitution | The fonts that ship with the claimed OS | A Linux font stack behind a Windows user agent |
| Device pixel ratio | Matches the screen dimensions reported | A fractional ratio on a claimed standard display |
The second row is the one containers fail. A headless browser on a machine with no GPU has to fall back to software rendering, and the renderer string says so honestly while the canvas pixels quietly agree with it. Patching the string alone does not help, because the pixels it produced are still there to be hashed. The guide to CAPTCHAs in undetected-chromedriver covers the automation-flag side of the same problem.
Measuring this from inside your own stack is the only way to know what you actually ship. Drive the probe through the same browser your jobs use rather than trusting the launch flags.
# pip install playwright
from playwright.sync_api import sync_playwright
PROBE = """() => {
const c = document.createElement('canvas').getContext('2d');
c.font = '16px Arial';
c.fillText('probe', 2, 16);
return c.canvas.toDataURL().slice(-32);
}"""
with sync_playwright() as p:
page = p.chromium.launch(headless=True).new_page()
page.goto("https://example.com/")
print(page.evaluate(PROBE)) # compare against your real browserRun that headless, then run it again with the headless flag turned off, then compare both against a normal browser window on the same machine. Three identical tails mean the canvas is not what is giving you away. Three different ones tell you where to look next. The Playwright CAPTCHA solver page covers wiring this into a real crawl.
Why randomising the canvas backfires
Randomising a canvas fingerprinting value feels like the obvious defence, and it usually makes things worse. The reasoning is short. A common hash puts you in a large group. A rare but fixed hash puts you in a small group. A hash that is different on every read puts you in a group that real browsers are almost never in, because normal hardware is deterministic.
Worse, the instability is trivially cheap to test for. Reading the canvas twice in one page load and comparing costs a detection script nothing, and it converts your defence into a boolean signal about the client. That is a strictly worse trade than the identifying value you were trying to hide.
There is a real exception. Browsers that randomise per origin and per session, rather than per read, keep the hash stable inside a page view while breaking cross-site linkage. That is a considered design and it does not read as automation. Per read noise from a patched automation stack is a different thing entirely, and it is what shows up in your logs as sudden challenges on a stack that worked yesterday.
The practical rule: prefer a real browser on real hardware with nothing patched, and accept a boring fingerprint. If you cannot have that, keep whatever fingerprint you do have stable and internally consistent.
What none of this fixes
Canvas fingerprinting work changes how often you are challenged. It does not change what happens once you are. CapSkip does not touch your canvas hash, your WebGL renderer or your font list, and no solver can, because those are properties of the machine drawing the pixels rather than of the challenge you were served.
Treat them as two separate jobs. Consistency work reduces the challenge rate. The solver handles the challenges that still arrive, which on a well behaved stack is a smaller number, not zero. Anything promising to fix both at once is selling you one of them.
Running the solver on a server instead
Fingerprint testing usually happens on a workstation with a real GPU, while the crawl runs somewhere else entirely. That split is fine, and it does not force the solver onto every worker:
| Mode | Listens on | Use it when |
|---|---|---|
| Local | 127.0.0.1, that device only | Browser and solver run on one machine |
| Server | Your network address or public IP | Workers, a VPS or a hosted platform call in over the API |
Point the SDK host at the solver machine and the rest of your code is unchanged, so a fleet of browsers can share one instance while each keeps its own profile. A static public IP is recommended when the callers sit outside your network. The settings live under connection settings, and Server mode is still your own hardware and still unmetered: it moves where the solver runs, never who owns it.
FAQ
Can I just block canvas readback entirely?
You can, and it is loud. A canvas that refuses to render, returns a blank image, or throws on readback is rarer than almost any real fingerprint, so the block itself becomes the identifying feature. Blocking makes sense for a privacy browser whose users all look identical to each other. It makes no sense for a single automation client trying to look ordinary.
Does a headless browser have a different canvas fingerprint?
Often, and usually for hardware reasons rather than headless ones. A container without a GPU renders through a software fallback, and different pixels come out the other end. Missing system fonts push it further, because a substituted font rasterises differently from the one that was asked for. Giving the machine a real GPU and a normal font set closes most of that gap.
Is canvas fingerprinting enough to identify me on its own?
No, and it is not used that way. It is one input among many, sitting next to the WebGL renderer, the font list, the TLS handshake, the IP reputation and how the session behaves. That is why a single perfect value does not save a stack that contradicts itself elsewhere, and why fixing one signal in isolation rarely changes the challenge rate much.
Will solving the CAPTCHA fix my fingerprint?
No. Solving clears the challenge in front of you and changes nothing about why you were shown it. If your challenge rate is climbing, the fingerprint work is what brings it down. The solver is what keeps the job moving in the meantime, and the two are worth budgeting for separately.
The shortest version
Read your canvas hash, run it five times, and check that you get one value rather than five. Then check that value against the WebGL renderer, the font stack and the platform your user agent claims, because contradictions cost you more than any single odd number. Do not add noise: per read randomisation is detectable in two lines and puts you in a group real browsers are never in. Fix the stack first, then stop worrying about the challenges that remain. The CAPTCHA solver for web scraping page covers running this at crawl scale. That leaves the economics: captcha bypass running on hardware you own costs nothing per solve, so the challenges you fail to avoid never turn into a bill.
