Widely available Supported across all major browsers. Safe to use in production.

Browser support

Feature Desktop Mobile
Chrome
Edge
Firefox
Safari
Chrome Android
Safari iOS
37
15
48
15.4
37
15.4

The navigator.hardwareConcurrency read-only property returns the number of logical processors available to run threads on the user's computer.

37
15
48
15.4
37
15.4
1+Supported (version) Not supported Has note Sub-feature descriptions sourced from MDN Web Docs (CC BY-SA 2.5)
Notes 2 item(s)
Implementation note
  • The value of this property is clamped to 4 or 8 cores, to prevent device fingerprinting. See bug 233381.
Removed
  • This feature was removed in a later browser version (11)
Notes 2 item(s)
Implementation note
  • The value of this property is clamped to 4 or 8 cores, to prevent device fingerprinting. See bug 233381.
Removed
  • This feature was removed in a later browser version (11)
Notes 2 item(s)
Implementation note
  • The value of this property is clamped to 4 or 8 cores, to prevent device fingerprinting. See bug 233381.
Removed
  • This feature was removed in a later browser version (11)
Notes 2 item(s)
Implementation note
  • The value of this property is clamped to 4 or 8 cores, to prevent device fingerprinting. See bug 233381.
Removed
  • This feature was removed in a later browser version (11)

Syntax

JAVASCRIPT
let workerList = [];

for (let i = 0; i < window.navigator.hardwareConcurrency; i++) {
  let newWorker = {
    worker: new Worker("cpu-worker.js"),
    inUse: false,
  };
  workerList.push(newWorker);
}

Use cases

  • Using hardwareConcurrency

    The navigator.

Cautions

  • May not be supported in older browsers.

Implementation notes

  • Some APIs require a secure context (HTTPS) or user activation. Check the requirements before use.