Favorites

JavaScript Infinity Property

☕
Enjoying this site?

Help keep it running with a small coffee donation. Every bit of support is appreciated!

Buy us a coffee
Infinity
JavaScript Global propertyThis property is supported by all modern browsers.
Updated 28th November 2026

Infinity is a numeric value larger than any other number. It is the result of overflowing calculations such as 1 / 0.

Description

The global Infinity property is a number representing positive infinity, greater than any other number; -Infinity is its negative. It results from dividing a non-zero number by zero and from calculations that exceed Number.MAX_VALUE. It's also a handy starting value when searching for a minimum.

Infinity behaves as you'd expect mathematically: any finite number divided by it is 0, and Infinity - Infinity is NaN. Number.POSITIVE_INFINITY and Number.NEGATIVE_INFINITY are the same values under longer names.

JSON.stringify() turns Infinity into null, so it doesn't survive a round trip through JSON. Use Number.isFinite() to check that a calculated value is an ordinary number.

Syntax

Infinity

Value

The numeric value Infinity.

Example

console.log(1 / 0, -1 / 0);
console.log(Infinity > Number.MAX_VALUE);
let lowest = Infinity;
for (const n of [7, 3, 9]) lowest = Math.min(lowest, n);
console.log(lowest);

Browser Support

The following information will show you the current browser support for the Infinity property. Hover over a browser icon to see the version that first introduced support for this property.

This property is supported by all modern browsers.

Desktop

Chrome
Edge
Firefox
Opera
Safari

Tablets & Mobile

Chrome Android
Firefox Android
Opera Android
Safari iOS
Samsung Internet
Android WebView
-
Supported Unknown Not supported
☕
Enjoying this site?

Help keep it running with a small coffee donation. Every bit of support is appreciated!

Buy us a coffee