Math function precision
Tiny differences in Math.tan, acosh, sinh and others across engines and CPUs.
In one line
Can run maths tests and use the last digits to tell your browser apart
Tiny differences in Math.tan, acosh, sinh and others across engines and CPUs.
Results of about 10 transcendental functions differ in the last digits between V8, SpiderMonkey, JavaScriptCore and OS math libraries. Identifies engine version and sometimes CPU family. Firefox 145 made some math more uniform.
What it can and can't do
What the user does: Nothing. It happens when the page loads
It can
- Compute about 10 maths functions and compare the last digits
- Tell Chrome, Firefox and Safari engines apart
- Sometimes guess your system
It cannot
- See your files or what you typed
- Ask permission first
- Name your exact device model
- Know who you are by itself
Browser support
| Browser | Status | First version | Released | Note |
|---|---|---|---|---|
| Chrome | Supported | 1 | 2008-12-11 | None |
| Edge | Supported | 12 | 2015-07-29 | None |
| Firefox | Supported | 1 | 2004-11-09 | None |
| Safari | Supported | 3 | 2007-10-26 | None |
| Safari on iPhone | Supported | 3.2 | 2010-04-03 | None |
| Chrome on Android | Supported | 18 | 2012-06-27 | None |
| Samsung Internet | Supported | 1.0 | 2013-04-27 | None |
How a site asks for it
| API | Math.acos(), asinh(), atanh(), expm1(), log1p(), sinh(), tan(), pow() ... |
| How access is granted | none |
| What the user sees | None |
| Needs a secure context (HTTPS) | No |
| Needs a user gesture | No |
| How long it lasts | read fresh on every page load; nothing stored |
| How to take it back | none needed (no grant) |
| Inside an iframe | Readable from cross-origin iframes too (same values) |
Typical flow
- Page script reads the value
- No prompt is shown
Data you get
Shape: object
How often: static per session
| Field | Type | Unit | Range | Precision |
|---|---|---|---|---|
values | list | float64 | about 10 numbers | 17 significant digits |
Technical limits
- Engine class only
The story
What it is
Tiny differences in how Math.tan and similar functions round can show which browser engine and chip you have.
For you
You see nothing. Your browser quietly does a few unusual math steps and looks at the last digits. They differ a little between engines such as Chrome, Firefox and Safari.
For makers
Math results are usually the same everywhere, but tiny gaps exist. Fraud tools use them to check that the browser is what it claims. Trackers add them to a device ID.
Where you see it
| Type | Example | Apps |
|---|---|---|
| security | A bot detector spots a script that claims to be Safari but gives Chrome style math results. | None named |
| analytics | A fingerprint library adds math results to a device ID. | FingerprintJS, CreepJS |
| ads | An ad script tells browser engines apart when the user agent string is hidden. | None named |
| games | A web game with physics avoids risky math so a match plays the same on every browser. | None named |
| education | A graphing tool like Desmos controls its math rounding so students see the same curve on any device. | Desmos |
| banking | A bank adds the math engine result to a check that a login came from a real browser. | None named |
| developer | A developer tests number code in three browsers to find tiny rounding differences. | None named |
Risks
- Hard to change
- Adds to a device ID
Good uses and abuse
Legitimate uses
- None
Known abuse
- Engine fingerprint
Scores
| Score | Value | Meaning |
|---|---|---|
| Sensitivity | 1 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 | 1.5 | Rough identifying entropy, when known |
History
- 2025-11, Firefox 145: Android math operations made more consistent
Sources
How well checked: Based on official documentation.