Device Memory API exposes the approximate amount of RAM on your device through navigator.deviceMemory.
🔬 How It Works
const ram = navigator.deviceMemory;
console.log(ram); // e.g., 8 (GB)
📊 Possible Values
Values are rounded to powers of 2: 0.25, 0.5, 1, 2, 4, 8 GB. Values above 8GB are reported as 8.
| Actual RAM | Reported Value |
|---|---|
| 2 GB | 2 |
| 4 GB | 4 |
| 8 GB | 8 |
| 16+ GB | 8 |
🛡️ Spoofing Considerations
Device memory should match the spoofed device type. A mobile device with 8GB RAM is less common than a desktop.