Testing

navigator.hardwareConcurrency: Browsers, Use Cases, Limits

navigator.hardwareConcurrency works in Chrome 37+, Edge 15+, Firefox 48+, Safari 10.1+, Opera 24+, and Samsung Internet 4+. See browser support and uses.

Author

Prince Dewani

May 1, 2026

navigator.hardwareConcurrency is a read-only JavaScript property defined in the WHATWG HTML Living Standard that returns the number of logical processor cores available to a web page or Web Worker. It works in Chrome 37+, Edge 15+, Firefox 48+, Safari 10.1+ on macOS, Safari 10.3+ on iOS, Opera 24+, and Samsung Internet 4+, while Internet Explorer never added support.

This guide covers what navigator.hardwareConcurrency is, which browsers support it, how to use it, its use cases, and its known limitations.

What is navigator.hardwareConcurrency?

navigator.hardwareConcurrency is a read-only property on the Navigator object and on a Web Worker's WorkerNavigator. It returns an integer between 1 and the number of logical processor cores the browser exposes. The WHATWG HTML Living Standard defines it under the NavigatorConcurrentHardware mixin in section 10.2.7.

Which browsers does navigator.hardwareConcurrency support?

Every modern desktop and mobile browser supports navigator.hardwareConcurrency. Internet Explorer never added support, and Safari clamps the value on macOS and iOS to limit hardware fingerprinting.

Loading browser compatibility data...
Note

Note: navigator.hardwareConcurrency reports different values on Safari macOS, Safari iOS, and Firefox in privacy mode. Test it on real browsers and OS with TestMu AI. Try TestMu AI free!

How do you use navigator.hardwareConcurrency?

Read navigator.hardwareConcurrency in any modern browser to get the number of logical cores the browser exposes, then size your Web Worker pool, thread budget, or parallel queue against that integer.

  • Open the DevTools console: Press F12 or right-click and choose Inspect, then switch to the Console tab in any supported browser.
  • Read the property: Type navigator.hardwareConcurrency and press Enter. The returned integer is the number of logical cores the browser is willing to expose.
  • Add a fallback for older browsers: Use navigator.hardwareConcurrency || 2 so single-threaded pages still get a sensible default if the property is undefined.
  • Size your Web Worker pool: Spawn one Worker for each logical core, up to a project-specific cap, and reuse the pool across tasks instead of creating new Workers per request.
  • Verify on real devices: Run the snippet on a Mac, an iPhone, and a low-end Android to see the WebKit cap in action and confirm your fallback path triggers when expected.
const cores = navigator.hardwareConcurrency || 2;
console.log(`This browser reports ${cores} logical cores.`);

const workerPool = [];
for (let i = 0; i < cores; i++) {
    workerPool.push(new Worker("task-runner.js"));
}

console.log(`Spawned ${workerPool.length} workers for parallel work.`);

If the snippet logs 1 in a browser you expect to support the API, the page is likely running with privacy.resistFingerprinting on, in a private window with extra hardening, or inside a clamped WebKit build on iOS.

What are the use cases of navigator.hardwareConcurrency?

Anything that scales with parallelism uses navigator.hardwareConcurrency to decide how much work to fan out, from Web Worker pools and WebAssembly threads to adaptive UI on low-end devices.

  • Web Worker pools: Spawn one Worker per logical core to run image filters, codecs, or heavy parsers without blocking the main thread.
  • WebAssembly threading: Multi-threaded WebAssembly modules read the property at startup to set their thread budget, matching the browser's exposed core count.
  • Adaptive performance tiers: A device reporting 2 cores can drop heavy effects, lower video resolution, or skip animations to keep the page responsive.
  • Render scheduling: Game engines and 3D apps split the render loop, physics worker, and asset decoder across the reported core budget for smoother frame pacing.
  • Heuristic device classification: Combined with navigator.deviceMemory, the core count helps split traffic into low, mid, and high tiers without server-side detection.
  • Background work throttling: A page can pause analytics, prefetching, or service-worker tasks on a 2-core report and let them catch up on a 16-core machine.
...

What are the limitations of navigator.hardwareConcurrency?

navigator.hardwareConcurrency is a useful hint, but the value is shaped by browser caps, privacy spoofing, and hyperthreading rather than the raw silicon underneath.

  • Capped on Safari: WebKit returns at most 8 on macOS and at most 2 on iOS, so a 24-core Mac Pro and a 4-core M-series iPad both report the cap rather than the real count.
  • Privacy spoofing in Firefox and Brave: Firefox returns 2 when privacy.resistFingerprinting is on. Brave randomizes the value between 2 and the true count or 8, depending on the shield mode.
  • Logical, not physical: The number includes hyperthreaded virtual cores, so an 8-physical-core CPU may report 16. The browser cannot distinguish physical from logical cores.
  • No CPU detail: The property does not expose architecture, clock speed, big.LITTLE topology, or current load. Two devices with the same core count can have very different real performance.
  • Static read: It returns a single integer, with no event for thermal throttling, power-state changes, or VM resizing. Reading it once at startup is the standard pattern.

In my experience, the bigger trap is treating the value as a hard hardware count: a 16-core MacBook reports 8 in Safari and a 4-core M-series iPad reports 2, so any worker pool sized strictly to navigator.hardwareConcurrency runs well below the real ceiling on Apple devices. Always feature-detect, cap your pool against your own constants, and verify the live value on a real device.

...

Citations

All navigator.hardwareConcurrency version numbers and platform notes in this guide come from these primary sources:

Author

Prince Dewani is a Community Contributor at TestMu AI, where he manages content strategies around software testing, QA, and test automation. He is certified in Selenium, Cypress, Playwright, Appium, Automation Testing, and KaneAI. Prince has also presented academic research at the international conference PBCON-01. He further specializes in on-page SEO, bridging marketing with core testing technologies. On LinkedIn, he is followed by 4,300+ QA engineers, developers, DevOps experts, tech leaders, and AI-focused practitioners in the global testing community.

Open in ChatGPT Icon

Open in ChatGPT

Open in Claude Icon

Open in Claude

Open in Perplexity Icon

Open in Perplexity

Open in Grok Icon

Open in Grok

Open in Gemini AI Icon

Open in Gemini AI

Copied to Clipboard!
...

3000+ Browsers. One Platform.

See exactly how your site performs everywhere.

Try it free
...

Write Tests in Plain English with KaneAI

Create, debug, and evolve tests using natural language.

Try for free

Frequently asked questions

Did you find this page helpful?

More Related Hubs

TestMu AI forEnterprise

Get access to solutions built on Enterprise
grade security, privacy, & compliance

  • Advanced access controls
  • Advanced data retention rules
  • Advanced Local Testing
  • Premium Support options
  • Early access to beta features
  • Private Slack Channel
  • Unlimited Manual Accessibility DevTools Tests