How the Battery Status API Works
The Battery Status API gives web pages a promise-based method, navigator.getBattery(), that resolves to a BatteryManager object. That object exposes four live properties: level (a fraction from 0 to 1), charging (a boolean), chargingTime (seconds until full, or 0 if already full), and dischargingTime (seconds until empty, or Infinity while charging or when the value isn't known yet).
The object also fires four events whenever those values change: levelchange, chargingchange, chargingtimechange, and dischargingtimechange. This tool listens to all four, so the gauge, percentage, badge, and stat cards update instantly the moment your operating system reports a change - no polling or manual refresh needed.
Why Some Browsers Don't Support It
Browser support for this API has shrunk over time, not grown. Early on, a battery's precise level and time-remaining values were shown to be usable as part of a "fingerprint" that could help identify and track an individual browser session across sites, since the combination of exact values changes rarely and is fairly unique moment-to-moment. In response, Safari never implemented the API at all, and other browsers have restricted it in certain contexts - such as some private/incognito windows - as a privacy hardening measure.
This tool detects unavailability directly (checking whether navigator.getBattery exists as a function before calling it) and shows a clear, honest "not supported" message instead of throwing a silent error or hanging on a loading state forever.
Common Use Cases
How to Read the Stats
| Stat | Source Property | Meaning |
|---|---|---|
| Charge Level | level | Current battery charge as a percentage (0-100%) |
| Charging Status | charging | Whether the device is currently plugged in and charging |
| Time to Full Charge | chargingTime | Estimated seconds until 100%; shows "Fully charged" at 0 while charging |
| Time Until Empty | dischargingTime | Estimated seconds of runtime left; shows "Unknown" as Infinity while charging or before the OS has enough data |
All four stats update live as the underlying BatteryManager fires its change events, so you don't need to refresh the page to see a charger being plugged in or unplugged reflected on screen.
Frequently Asked Questions
It was originally proposed as a W3C specification, but after research showed the exposed values could be combined into a short-lived device fingerprint, browser vendors reconsidered it. Chrome, Edge, and Opera still implement it today, but it is no longer treated as an actively advancing standard.
Mozilla removed it in 2016 after a widely cited study showed that combining the level and dischargingTime values could create a short-lived identifier able to track a device across sites for a period of time, even in private browsing. Firefox has not reintroduced it.
No. level, charging, chargingTime, and dischargingTime say nothing about capacity loss or cycle count. That information isn't exposed to web pages at all - you'd need an OS-level report, such as Windows' powercfg /batteryreport or macOS's System Information power panel.
level is a floating-point fraction between 0 and 1, but browsers may round or clamp it before reporting it, partly to reduce its usefulness for fingerprinting - so two devices at slightly different actual charge levels can display the same rounded percentage.
From the same OS-level power management interfaces your battery icon uses - for example the Windows Power API, macOS's IOKit power sources, or Android's BatteryManager. The browser is reading through a JavaScript wrapper around those, not measuring the battery independently.