JavaScript Navigator gpu Property

Beginner
5 min read
Updated: Nov 2026
3 examples
Property

Definition

navigator.gpu is a read-only property that returns the GPU object for this browsing context — the entry point for the WebGPU API (MDN).

Read the notes below before you rely on this property. Prefer feature detection when support is limited.

Syntax

Use navigator.gpu. Start with this line.

JavaScript
navigator.gpu
CallWhat it does
navigator.gpuPrimary signature.

Built into the browser. Read navigator.gpu on Navigator — no import required.

Library declarations
JavaScript
navigator.gpu

Parameters

ParameterDescription
requestAdapter()Required. Pick a GPU adapter (or null)
requestDevice()Required. Get a usable GPUDevice

Return Value

Return ValueDescription
*GPU object

JavaScript Examples

Example 1 — Feature-Detect

Check whether WebGPU is available before calling it.

JavaScript
if (!navigator.gpu) {
  console.log("WebGPU not supported.");
} else {
  console.log("WebGPU available");
}
Try It Yourself

How It Works

  1. Test navigator.gpu. Falsy means the API is missing here.
  2. Log a clear message. Same idea as MDN’s early throw, without crashing the page.
  3. Keep a fallback. Use WebGL/Canvas 2D when WebGPU is absent.
  4. Still need HTTPS. Insecure contexts often hide the property.

Example 2 — requestAdapter

Ask the browser for a GPUAdapter (think: the graphics card).

JavaScript
async function getAdapter() {
  if (!navigator.gpu) {
    console.log("WebGPU not supported.");
    return null;
  }
  const adapter = await navigator.gpu.requestAdapter();
  if (!adapter) {
    console.log("Couldn't request WebGPU adapter.");
    return null;
  }
  console.log("adapter ready");
  return adapter;
}

getAdapter();
Try It Yourself

How It Works

  1. Detect first. Exit when navigator.gpu is missing.
  2. Await requestAdapter(). Returns a Promise for a GPUAdapter.
  3. Check for null. MDN: no matching adapter is possible.
  4. Continue only if ready. Next step is requestDevice().

Example 3 — requestDevice

MDN-style init: adapter → device for real WebGPU work.

JavaScript
async function init() {
  if (!navigator.gpu) {
    console.log("WebGPU not supported.");
    return;
  }

  const adapter = await navigator.gpu.requestAdapter();
  if (!adapter) {
    console.log("Couldn't request WebGPU adapter.");
    return;
  }

  const device = await adapter.requestDevice();
  console.log("device ready: " + (device ? "yes" : "no"));
}

init();
Try It Yourself

How It Works

  1. Gate on support. Same first check as MDN.
  2. Request an adapter. Bail if null.
  3. Request a device. GPUDevice is what you use for GPU work.
  4. Log success. From here you create buffers, shaders, and pipelines.

Browser Support

Navigator.gpu (WebGPU entry point) is Limited availability (not Baseline) on MDN. It requires a secure context. It is not Deprecated, Experimental, or Non-standard.

✓ Limited · Not Baseline

Navigator.gpu

Available in modern Chromium (Chrome/Edge ~113+ on major desktop platforms), Safari 26+, and Firefox on supported OS builds. Always feature-detect — adapter may still be null.

Limited Not Baseline
Google Chrome 113+ desktop (platform-dependent); Android 121+
Supported*
Microsoft Edge 113+ on supported platforms
Supported*
Apple Safari 26+ (macOS / iOS / iPadOS)
Supported*
Mozilla Firefox 141+ Windows; expanding on macOS
Partial
Opera Chromium-based — follows Chrome WebGPU
Supported*
navigator.gpu Limited

Bottom line: Detect navigator.gpu over HTTPS, check requestAdapter() for null, then requestDevice() — keep a non-WebGPU fallback.

Frequently Asked Questions

It is a read-only Navigator property that returns the GPU object for the current browsing context — the entry point for the WebGPU API (MDN).
MDN does not mark it Deprecated, Experimental, or Non-standard. It is Limited availability / not Baseline — missing or incomplete on some browsers and platforms. Always feature-detect.
Yes. navigator.gpu is available only in secure contexts (HTTPS or localhost) in supporting browsers.
GPU.requestAdapter() asks the browser for a GPUAdapter that represents the user’s GPU. If none is available, it may resolve to null — always check the result.
WebGL is the older, widely supported graphics API. WebGPU is the modern API for high-performance graphics and GPU compute, with an adapter → device model.
No. It is read-only. You use the returned GPU object to request adapters and devices; you do not assign to navigator.gpu.

Next: hardwareConcurrency

Learn how to read logical CPU cores for sizing Worker pools.

hardwareConcurrency →

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.

11 people found this page helpful