JavaScript (ES2026) reference · Number Methods and Properties

JavaScript Number.EPSILON Property

The smallest difference between 1 and the next representable number, used as a tolerance when comparing floats.

JavaScript (ES2026) Since ES2015

Create a free account to save this page, take notes and track your progress. Sign in

Syntax

Number.EPSILON

Return value

About 2.220446049250313e-16.

Examples

The valueTry it yourself
console.log(Number.EPSILON);

Output

2.220446049250313e-16
Compare floating-point resultsTry it yourself
const nearlyEqual = (a, b) => Math.abs(a - b) < Number.EPSILON;
console.log(0.1 + 0.2 === 0.3, nearlyEqual(0.1 + 0.2, 0.3));

Output

false true

Version history

VersionChange
JavaScript ES2015Added

Was this page helpful?