JavaScript Number.isFinite() Method

Beginner
5 min read
Updated: Nov 2026
3 examples
Method

Definition

Number.isFinite(value) returns true only when value is a number and is finite — not Infinity, -Infinity, or NaN. It is a static method (ES2015) and does not coerce types.

Pass the required arguments shown below. Check return values and browser support before you rely on the result.

Syntax

Call Number.isFinite. Start with this line.

JavaScript
Number.isFinite(value)
CallWhat it does
Number.isFinite(value)Primary signature.
Number.isFinite(...)Call with the arguments your case needs.

Built into JavaScript. Call Number.isFinite(...) on the Number constructor — no import required.

Library declarations
JavaScript
Number.isFinite(value)

Parameters

ParameterDescription
valueRequired. Any value to test

Return Value

Return ValueDescription
*true or false

JavaScript Examples

Example 1 — Finite Numbers Pass

Normal numbers — small or huge — are finite when their type is number.

JavaScript
console.log(Number.isFinite(10 / 5));  // true
console.log(Number.isFinite(-3.5));    // true
console.log(Number.isFinite(2e64));    // true
Try It Yourself

How It Works

  1. Division result. 10 / 5 is the number 2 → finite.
  2. Decimals count. -3.5 is still a finite number (not an integer check).
  3. Large is OK. 2e64 is huge but still finite — finiteness ≠ “safe integer.”
  4. Type matters. All three values have typeof === "number".

Example 2 — Infinity and NaN Fail

Special number values are not finite.

JavaScript
console.log(Number.isFinite(1 / 0));      // false — Infinity
console.log(Number.isFinite(-1 / 0));     // false — -Infinity
console.log(Number.isFinite(0 / 0));      // false — NaN
console.log(Number.isFinite(NaN));        // false
Try It Yourself

How It Works

  1. Divide by zero. 1 / 0 becomes Infinity → not finite.
  2. Negative infinity. Same rule for -Infinity.
  3. Indeterminate form. 0 / 0 is NaN — type number, but not finite.
  4. Use before formatting. Guard charts and toFixed against these specials.

Example 3 — No Coercion (vs Global isFinite)

Strings and null fail with Number.isFinite, but pass with the global function.

JavaScript
console.log(Number.isFinite("25"));  // false
console.log(isFinite("25"));         // true  — coerces to 25

console.log(Number.isFinite(null));  // false
console.log(isFinite(null));         // true  — null → 0
Try It Yourself

How It Works

  1. Strict type check. "25" is a string → Number.isFinite returns false.
  2. Global coerces. isFinite("25") converts to 25 first → true.
  3. null trap. Global treats null as 0; Number.isFinite(null) does not.
  4. Accept text safely. Parse first: Number.isFinite(Number("25")).

Browser & Runtime Support

Number.isFinite() is part of ES2015 and is Baseline Widely available in modern browsers and Node.js.

✓ Baseline · ES2015

Number.isFinite()

Supported in Chrome, Firefox, Safari, Edge, and Node.js for years. Safe for modern apps without a polyfill.

98% Modern browser support
Google Chrome Supported · Desktop & Mobile
Full support
Mozilla Firefox Supported · Desktop & Mobile
Full support
Apple Safari Supported · macOS & iOS
Full support
Microsoft Edge Supported · Chromium
Full support
Internet Explorer No native support · Use a polyfill
Polyfill
Opera Supported · Modern versions
Full support
Samsung Internet Supported · Android
Full support
Bun Supported · JavaScript runtime
Supported
Deno Supported · JavaScript runtime
Supported
Node.js Supported · Server runtime
Supported
Android WebView Supported · Modern WebView
Full support
Number.isFinite Excellent

Bottom line: Use Number.isFinite for new code. Fall back to a polyfill only if you must support very old environments.

Frequently Asked Questions

Number.isFinite(value) returns true only when value is of type number and is finite — not Infinity, -Infinity, or NaN. Example: Number.isFinite(10 / 5) is true; Number.isFinite(1 / 0) is false.
Yes. Call it on Number itself: Number.isFinite(x). Do not call it on a number instance like (5).isFinite() — that is not the Number API.
Global isFinite() coerces the argument to a number first, so isFinite("25") is true. Number.isFinite() never coerces — Number.isFinite("25") is false because the value is a string.
No. NaN is not a finite number, so Number.isFinite(NaN) is false. The same applies to Infinity and -Infinity.
Both return false with Number.isFinite. Global isFinite(null) returns true because null coerces to 0 — another reason to prefer the Number static method.
It is Baseline Widely available (ES2015) and supported in every modern browser and Node.js.

Next: isInteger()

Learn how to check for integer number values without coercion.

isInteger() tutorial →

About the author

Mari Selvan M P
Mari Selvan M P 🔗

Developer, cloud engineer, and technical writer

  • Experience 12 years building web and cloud systems
  • Focus Full Stack Development, AWS, and Developer Education

I write practical tutorials so students and working developers can learn by doing—from databases and APIs to deployment on AWS.

9 people found this page helpful