Math function precision
Evaluates Math.tan, cosh, expm1 and similar at odd inputs and compares the exact digits.
In one line
Can run maths tests and use the last digits to tell your browser and chip apart
Evaluates Math.tan, cosh, expm1 and similar at odd inputs and compares the exact digits.
JS engines and CPU math libraries round the last bits differently, so a few results separate V8, SpiderMonkey and JavaScriptCore and sometimes the OS and CPU architecture.
What it can and can't do
What the user does: Nothing. It happens when the page loads
It can
- Compute a few unusual maths results
- Tell Chrome, Firefox and Safari engines apart by tiny digit differences
- Sometimes guess your system and chip type
- Spot a faked browser label
It cannot
- See your files or what you typed
- Ask permission first
- Know who you are by itself
- Tell your exact device model
Browser support
| Browser | Status | First version | Released | Note |
|---|---|---|---|---|
| Chrome | Supported | 1 | 2008-12-11 | None |
| Edge | Supported | 79 | 2020-01-15 | None |
| Firefox | Supported | 1 | 2004-11-09 | None |
| Safari | Supported | 1 | 2003-06-23 | None |
| Safari on iPhone | Supported | 1 | 2007-06-29 | None |
| Chrome on Android | Supported | 1 | Not listed | None |
| Samsung Internet | Supported | 5.0 | 2016-12-15 | None |
How a site asks for it
| API | Math.tan(-1e300); Math.sinh(1); Math.acosh(1e300); Math.pow(Math.PI,-100) |
| How access is granted | none |
| What the user sees | Not listed |
| Needs a secure context (HTTPS) | No |
| Needs a user gesture | No |
| How long it lasts | Not listed |
| How to take it back | Not listed |
| Inside an iframe | Not listed |
Typical flow
- Evaluate a short list of Math calls
- Serialize to full precision strings
- Compare against known engine values
Data you get
What comes back: 6 to 10 doubles at 17 significant digits
Shape: list
| Field | Type | Unit | Range | Precision |
|---|---|---|---|---|
Math.tan(-1e300) | float | None | engine specific | full double precision |
Technical limits
- Same engine and CPU yield the same values, low per-user entropy
The story
What it is
A script calculates unusual math functions and compares exact digits, which differ slightly by engine and CPU.
For you
You see nothing. Your device does a few odd math problems and the tail digits can differ between browsers and chips. The answer helps identify your browser engine and system.
For makers
Math answers are meant to be the same everywhere, but tiny rounding differences exist. Fraud and bot teams use them to tell real browsers from fake ones, and trackers add them to device IDs.
Where you see it
| Type | Example | Apps |
|---|---|---|
| security | A bot detector runs math tests and sees results that do not match the browser it claims to be. | None named |
| analytics | A fingerprint library adds the exact digits from a few math calls to a visitor ID. | FingerprintJS, CreepJS |
| games | A physics heavy browser game makes sure players on different devices get the same results, so it avoids relying on risky math. | None named |
| ads | An ad script uses math results to separate browser engines when the user agent string is hidden. | None named |
| banking | A bank checks that the browser's math matches known real devices, to spot an emulator. | None named |
| creative | A web 3D tool runs on many chips and tests that its math gives matching shapes. | None named |
| education | A web calculator or graphing site like Desmos shows the same answer on every device by controlling how it rounds. | Desmos |
Risks
- Hard to change without breaking math
- Adds to a device ID
Good uses and abuse
Legitimate uses
- None
Known abuse
- Browser and architecture identification inside composite hashes
Scores
| Score | Value | Meaning |
|---|---|---|
| Sensitivity | 2 of 5 | How revealing the data is |
| Utility | 1 of 5 | How useful it is to honest apps |
| Friction | 0 of 5 | How much the user has to do |
| Fingerprint bits | 2 | Rough identifying entropy, when known |
History
- 2013-01, paper: Mulazzani et al. JS engine fingerprinting by conformance and speed
Related capabilities
Related
- JS and Web API feature detection (version pinning). Can test which web features exist to guess your exact browser version
Sources
How well checked: Based on official documentation.