Skip to Content
Platform.Ontology

Math function precision

Evaluates Math.tan, cosh, expm1 and similar at odd inputs and compares the exact digits.

Used to track youGraphics and fingerprintingJS engineWeb browsersWhen the page loads

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

BrowserStatusFirst versionReleasedNote
ChromeSupported12008-12-11None
EdgeSupported792020-01-15None
FirefoxSupported12004-11-09None
SafariSupported12003-06-23None
Safari on iPhoneSupported12007-06-29None
Chrome on AndroidSupported1Not listedNone
Samsung InternetSupported5.02016-12-15None

How a site asks for it

APIMath.tan(-1e300); Math.sinh(1); Math.acosh(1e300); Math.pow(Math.PI,-100)
How access is grantednone
What the user seesNot listed
Needs a secure context (HTTPS)No
Needs a user gestureNo
How long it lastsNot listed
How to take it backNot listed
Inside an iframeNot listed

Typical flow

  1. Evaluate a short list of Math calls
  2. Serialize to full precision strings
  3. Compare against known engine values

Data you get

What comes back: 6 to 10 doubles at 17 significant digits
Shape: list

FieldTypeUnitRangePrecision
Math.tan(-1e300)floatNoneengine specificfull 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

TypeExampleApps
securityA bot detector runs math tests and sees results that do not match the browser it claims to be.None named
analyticsA fingerprint library adds the exact digits from a few math calls to a visitor ID.FingerprintJS, CreepJS
gamesA physics heavy browser game makes sure players on different devices get the same results, so it avoids relying on risky math.None named
adsAn ad script uses math results to separate browser engines when the user agent string is hidden.None named
bankingA bank checks that the browser's math matches known real devices, to spot an emulator.None named
creativeA web 3D tool runs on many chips and tests that its math gives matching shapes.None named
educationA 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

ScoreValueMeaning
Sensitivity2 of 5How revealing the data is
Utility1 of 5How useful it is to honest apps
Friction0 of 5How much the user has to do
Fingerprint bits2Rough identifying entropy, when known

History

  • 2013-01, paper: Mulazzani et al. JS engine fingerprinting by conformance and speed

Sources

How well checked: Based on official documentation.

On this page