Device Memory API

Limited availability

This feature is not Baseline because it does not work in some of the most widely-used browsers.

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.

Determining device memory

There are two ways to determine the approximate amount of RAM a device has: use the Device Memory JavaScript API or accept Client Hints.

JavaScript API

You may query the approximate amount of RAM a device has by retrieving Navigator.deviceMemory or WorkerNavigator.deviceMemory.

js
const RAM = navigator.deviceMemory;

Client Hints

You may also use the Client Hints HTTP Header with the Device-Memory directive to retrieve the same approximate RAM capacity.

Interfaces

Extensions to other interfaces

Returns the approximate amount of device memory in gigabytes.

WorkerNavigator.deviceMemory Read only

Returns the approximate amount of device memory in gigabytes.

Specifications

Specification
Device Memory API

Browser compatibility

api.Navigator.deviceMemory

desktop mobile server
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
Node.js
deviceMemory
Chrome – Full support
Chrome 63 (Release date: 2017-12-06)
footnote
footnote From Chrome 147, reported values are 2, 4, 8, 16, and 32.
footnote Before Chrome 147, reported values were 0.25, 0.5, 1, 2, 4, and 8.
Edge – Full support
Edge 79 (Release date: 2020-01-15)
footnote
footnote From Edge 147, reported values are 2, 4, 8, 16, and 32.
footnote Before Edge 147, reported values were 0.25, 0.5, 1, 2, 4, and 8.
Firefox – No support
Firefox
footnote No support
Opera – Full support
Opera 50 (Release date: 2018-01-04)
footnote
footnote From Opera 131, reported values are 2, 4, 8, 16, and 32.
footnote Before Opera 131, reported values were 0.25, 0.5, 1, 2, 4, and 8.
Safari – No support
Safari
footnote No support
Chrome Android – Full support
Chrome Android 63 (Release date: 2017-12-05)
footnote
footnote From Chrome 147, reported values are 1, 2, 4, and 8.
footnote Before Chrome 147, reported values were 0.25, 0.5, 1, 2, 4, and 8.
Firefox for Android – No support
Firefox for Android
footnote No support
Opera Android – Full support
Opera Android 46 (Release date: 2018-05-14)
footnote
footnote From Chrome 147, reported values are 1, 2, 4, and 8.
footnote Before Chrome 147, reported values were 0.25, 0.5, 1, 2, 4, and 8.
Safari on iOS – No support
Safari on iOS
footnote No support
Samsung Internet – Full support
Samsung Internet 8 (Release date: 2018-07-18)
footnote
footnote From Chrome 147, reported values are 1, 2, 4, and 8.
footnote Before Chrome 147, reported values were 0.25, 0.5, 1, 2, 4, and 8.
WebView Android – Full support
WebView Android 63 (Release date: 2017-12-05)
footnote
footnote From Chrome 147, reported values are 1, 2, 4, and 8.
footnote Before Chrome 147, reported values were 0.25, 0.5, 1, 2, 4, and 8.
WebView on iOS – No support
WebView on iOS
footnote No support
Node.js – No support
Node.js
footnote No support

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support
No support
No support
See implementation notes.

api.WorkerNavigator.deviceMemory

desktop mobile server
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
Deno
deviceMemory
Chrome – Full support
Chrome 65 (Release date: 2018-03-06)
footnote
footnote From Chrome 147, reported values are 2, 4, 8, 16, and 32.
footnote Before Chrome 147, reported values are 0.25, 0.5, 1, 2, 4, and 8.
Edge – Full support
Edge 79 (Release date: 2020-01-15)
footnote
footnote From Edge 147, reported values are 2, 4, 8, 16, and 32.
footnote Before Edge 147, reported values are 0.25, 0.5, 1, 2, 4, and 8.
Firefox – No support
Firefox
footnote No support
Opera – Full support
Opera 52 (Release date: 2018-03-22)
footnote
footnote From Opera 131, reported values are 2, 4, 8, 16, and 32.
footnote Before Opera 131, reported values are 0.25, 0.5, 1, 2, 4, and 8.
Safari – No support
Safari
footnote No support
Chrome Android – Full support
Chrome Android 65 (Release date: 2018-03-06)
footnote
footnote From Chrome 147, reported values are 1, 2, 4, and 8.
footnote Before Chrome 147, reported values were 0.25, 0.5, 1, 2, 4, and 8.
Firefox for Android – No support
Firefox for Android
footnote No support
Opera Android – Full support
Opera Android 47 (Release date: 2018-07-23)
footnote
footnote From Chrome 147, reported values are 1, 2, 4, and 8.
footnote Before Chrome 147, reported values were 0.25, 0.5, 1, 2, 4, and 8.
Safari on iOS – No support
Safari on iOS
footnote No support
Samsung Internet – Full support
Samsung Internet 9 (Release date: 2018-09-15)
footnote
footnote From Chrome 147, reported values are 1, 2, 4, and 8.
footnote Before Chrome 147, reported values were 0.25, 0.5, 1, 2, 4, and 8.
WebView Android – Full support
WebView Android 65 (Release date: 2018-03-06)
footnote
footnote From Chrome 147, reported values are 1, 2, 4, and 8.
footnote Before Chrome 147, reported values were 0.25, 0.5, 1, 2, 4, and 8.
WebView on iOS – No support
WebView on iOS
footnote No support
Deno – No support
Deno
footnote No support

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support
No support
No support
See implementation notes.

http.headers.Sec-CH-Device-Memory

desktop mobile
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
Sec-CH-Device-Memory request header
Experimental
Chrome – Full support
Chrome 61 (Release date: 2017-09-05)
footnote , altname
altname Alternate name: Device-Memory
footnote Before Chrome 147, reported values were 0.25, 0.5, 1, 2, 4, and 8.
footnote From Chrome 147, reported values are 2, 4, 8, 16, and 32.
Chrome – Full support
Chrome 97 (Release date: 2022-01-04)
footnote
footnote Before Chrome 147, reported values were 0.25, 0.5, 1, 2, 4, and 8.
footnote From Chrome 147, reported values are 2, 4, 8, 16, and 32.
Edge – Full support
Edge 79 (Release date: 2020-01-15)
footnote , altname
altname Alternate name: Device-Memory
footnote Before Edge 147, reported values were 0.25, 0.5, 1, 2, 4, and 8.
footnote From Edge 147, reported values are 2, 4, 8, 16, and 32.
Edge – Full support
Edge 97 (Release date: 2022-01-06)
footnote
footnote Before Edge 147, reported values were 0.25, 0.5, 1, 2, 4, and 8.
footnote From Edge 147, reported values are 2, 4, 8, 16, and 32.
Firefox – No support
Firefox
footnote No support
Opera – Full support
Opera 48 (Release date: 2017-09-27)
footnote , altname
altname Alternate name: Device-Memory
footnote Before Opera 131, reported values were 0.25, 0.5, 1, 2, 4, and 8.
footnote From Opera 131, reported values are 2, 4, 8, 16, and 32.
Opera – Full support
Opera 83 (Release date: 2022-01-19)
footnote
footnote Before Opera 131, reported values were 0.25, 0.5, 1, 2, 4, and 8.
footnote From Opera 131, reported values are 2, 4, 8, 16, and 32.
Safari – No support
Safari
footnote No support
Chrome Android – Full support
Chrome Android 61 (Release date: 2017-09-05)
footnote , altname
altname Alternate name: Device-Memory
footnote From Chrome 147, reported values are 1, 2, 4, and 8.
footnote Before Chrome 147, reported values were 0.25, 0.5, 1, 2, 4, and 8.
Chrome Android – Full support
Chrome Android 97 (Release date: 2022-01-04)
footnote
footnote From Chrome 147, reported values are 1, 2, 4, and 8.
footnote Before Chrome 147, reported values were 0.25, 0.5, 1, 2, 4, and 8.
Firefox for Android – No support
Firefox for Android
footnote No support
Opera Android – Full support
Opera Android 45 (Release date: 2018-02-15)
footnote , altname
altname Alternate name: Device-Memory
footnote From Chrome 147, reported values are 1, 2, 4, and 8.
footnote Before Chrome 147, reported values were 0.25, 0.5, 1, 2, 4, and 8.
Opera Android – Full support
Opera Android 68 (Release date: 2022-03-30)
footnote
footnote From Chrome 147, reported values are 1, 2, 4, and 8.
footnote Before Chrome 147, reported values were 0.25, 0.5, 1, 2, 4, and 8.
Safari on iOS – No support
Safari on iOS
footnote No support
Samsung Internet – Full support
Samsung Internet 8 (Release date: 2018-07-18)
footnote , altname
altname Alternate name: Device-Memory
footnote From Chrome 147, reported values are 1, 2, 4, and 8.
footnote Before Chrome 147, reported values were 0.25, 0.5, 1, 2, 4, and 8.
Samsung Internet – Full support
Samsung Internet 18 (Release date: 2022-08-08)
footnote
footnote From Chrome 147, reported values are 1, 2, 4, and 8.
footnote Before Chrome 147, reported values were 0.25, 0.5, 1, 2, 4, and 8.
WebView Android – Full support
WebView Android 61 (Release date: 2017-09-05)
footnote , altname
altname Alternate name: Device-Memory
footnote From Chrome 147, reported values are 1, 2, 4, and 8.
footnote Before Chrome 147, reported values were 0.25, 0.5, 1, 2, 4, and 8.
WebView Android – Full support
WebView Android 97 (Release date: 2022-01-04)
footnote
footnote From Chrome 147, reported values are 1, 2, 4, and 8.
footnote Before Chrome 147, reported values were 0.25, 0.5, 1, 2, 4, and 8.
WebView on iOS – No support
WebView on iOS
footnote No support

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support
No support
No support
Experimental. Expect behavior to change in the future.
See implementation notes.
Uses a non-standard name
Has more compatibility info.

See also