Device & Network Info
Monitor battery status, network conditions, and device capabilities in real-time
Comprehensive diagnostic tool for checking Battery Status API, Network Information API, and Device Memory API. View charging state, connection type, bandwidth estimates, CPU cores, and RAM in real-time.
Battery API not supported on this device/browser.
Network Information API not supported on this device/browser.
- CPU Cores
- Logical processors
- Device Memory
- RAM (approximate)
About Device & Network Info
Device & Network Info provides real-time diagnostics of your device's hardware capabilities and network conditions using modern browser APIs. This tool helps developers build adaptive web applications that respond intelligently to device constraints and connection quality.
API Overview
1. Battery Status API
Monitor your device's power state to optimize application behavior based on battery level:
Key Metrics:
- Battery Level: Current charge percentage (0-100%)
- Charging State: Whether device is plugged in or running on battery
- Time to Full Charge: Estimated seconds until battery reaches 100% (when charging)
- Time to Discharge: Estimated seconds until battery depletes (when on battery)
Use Cases:
- Reduce animations and background processes when battery is low
- Defer heavy operations until device is charging
- Show battery warnings in long-running web applications
- Optimize video quality based on power state
2. Network Information API
Understand current connection quality to deliver appropriate content and optimize data usage:
Key Metrics:
- Effective Connection Type: Browser's assessment of network quality
4g- Fast connection (>= 700 Kbps downlink, < 150ms RTT)3g- Moderate connection (>= 150 Kbps, < 450ms RTT)2g- Slow connection (>= 50 Kbps, < 2000ms RTT)slow-2g- Very slow connection (< 50 Kbps, >= 2000ms RTT)
- Downlink: Effective bandwidth estimate in Mbps (megabits per second)
- RTT (Round-Trip Time): Network latency in milliseconds - time for a request to reach server and return
- Save Data: Whether user has enabled data saver mode in browser settings
Use Cases:
- Serve lower quality images/videos on slow connections
- Preload resources only on fast connections
- Show offline-ready UI on poor connections
- Respect user's data saver preferences
- Optimize API request frequency based on latency
3. Hardware Concurrency
Learn about available CPU resources to optimize computational tasks:
Metric:
- Logical Processors: Number of CPU cores/threads available for JavaScript execution
Use Cases:
- Determine optimal number of Web Workers for parallel processing
- Adjust complexity of animations and real-time effects
- Scale video encoding/decoding operations
- Optimize game physics calculations
4. Device Memory
Understand available RAM to prevent memory exhaustion:
Metric:
- Device Memory: Approximate RAM in gigabytes (rounded to nearest power of 2 for privacy)
Typical Values:
0.25GB - Very low-end devices0.5GB - Low-end devices1GB - Entry-level smartphones2GB - Mid-range devices4GB - Standard devices8GB+ - High-end devices
Use Cases:
- Limit cache size on low-memory devices
- Reduce number of simultaneously loaded resources
- Simplify DOM complexity for constrained devices
- Adjust image quality and resolution based on available RAM
Browser Compatibility
Wide Support
- Hardware Concurrency: Supported in all modern browsers (Chrome, Firefox, Safari, Edge)
Limited Support
-
Network Information API:
- ✅ Chrome/Edge 61+
- ✅ Android browsers
- ❌ Firefox (disabled by default)
- ❌ Safari/iOS (not supported)
-
Device Memory API:
- ✅ Chrome/Edge 63+
- ❌ Firefox (not supported)
- ❌ Safari (not supported)
-
Battery Status API:
- ⚠️ Chrome 38-103 (deprecated and removed)
- ⚠️ Firefox (disabled by default due to privacy concerns)
- ❌ Safari (never supported)
- Status: Largely deprecated across browsers
Privacy Considerations
These APIs have been subject to privacy scrutiny because they can be used for device fingerprinting - creating unique identifiers to track users across websites.
Current Status:
- Battery API: Deprecated/removed from most browsers due to fingerprinting concerns
- Network Info: Limited to prevent precise network identification
- Device Memory: Returns rounded values (powers of 2) to reduce fingerprinting precision
- Hardware Concurrency: Considered low-risk but can contribute to fingerprinting
If APIs show "Not Supported" or "Unknown": This is intentional browser behavior to protect your privacy. Not all browsers implement these APIs, and some have deliberately removed or restricted them.
Practical Applications
Adaptive Loading
// Example: Load appropriate image quality
const connection = navigator.connection?.effectiveType;
if (connection === "4g") {
loadHighResImages();
} else if (connection === "3g") {
loadMediumResImages();
} else {
loadLowResImages();
}Battery-Aware Processing
// Example: Defer heavy tasks when battery is low
if (battery.level < 0.2 && !battery.charging) {
deferNonCriticalTasks();
reduceBackgroundActivity();
}Memory-Conscious Caching
// Example: Adjust cache size based on device memory
const deviceMemory = navigator.deviceMemory || 4;
const maxCacheSize = deviceMemory * 50; // 50MB per GB of RAMDeveloper Tips
- Always check API availability before using:
if (navigator.getBattery) - Provide fallback behavior for unsupported APIs
- Don't rely solely on these metrics - they're hints, not guarantees
- Test across different devices and network conditions
- Respect user preferences like data saver mode
- Use Progressive Enhancement - enhance experience when APIs are available
- Monitor API deprecations - browser support can change over time
- Combine multiple signals for better decision-making
Troubleshooting
"API not supported"
- Normal behavior in many browsers (especially Safari, Firefox)
- Use feature detection and provide fallbacks
- Don't assume API availability
Battery API shows "Unknown"
- Desktop devices may not expose battery information
- API is deprecated in most modern browsers
- Privacy settings may block the API
Network values seem inaccurate
- Values are estimates, not precise measurements
- Can lag behind actual network changes
- Based on historical connection quality
Device Memory returns null
- Only supported in Chromium-based browsers
- Consider a default value (e.g., 4GB) for unsupported browsers
Related Tools
Comments