| [ Web Proxy ] |
| Viewing: https://developer.mozilla.org/en-US/docs/Web/API/Device_Memory_API | [Back] [Original] |
Get to know MDN better
This feature is not Baseline because it does not work in some of the most widely-used browsers.
Want more browser support for this feature? Tell us why.
Secure context: This feature is available only in secure contexts (HTTPS), in some or all supporting browsers.
Note: This feature is available in Web Workers.
The capabilities of a client device largely depend on the amount of available RAM. Traditionally, developers had to use heuristics and either benchmark a device or infer device capabilities based on other factors like the device manufacturer or User Agent strings.
There are two ways to determine the approximate amount of RAM a device has: use the Device Memory JavaScript API or accept Client Hints.
You may query the approximate amount of RAM a device has by retrieving Navigator.deviceMemory or WorkerNavigator.deviceMemory.
const RAM = navigator.deviceMemory;
You may also use the Client Hints HTTP Header with the Device-Memory directive to retrieve the same approximate RAM capacity.
Navigator.deviceMemory Read onlyReturns the approximate amount of device memory in gigabytes.
WorkerNavigator.deviceMemory Read onlyReturns the approximate amount of device memory in gigabytes.
| Specification |
|---|
| Device Memory API |
Sec-CH-Device-Memory headerThis page was last modified on Dec 15, 2025 by MDN contributors.
Your blueprint for a better internet.
Portions of this content are 19982026 by individual mozilla.org contributors. Content available under a Creative Commons license.
| Web Proxy Viewer | New URL | Original Page |