Only if the computer and browser expose orientation sensors. Most desktops and laptops have no magnetometer, so the compass reading is not available on them.
Device-orientation compass in the browser
This compass uses neither GPS nor the internet to point north: it reads your device's magnetometer through the browser's Device Orientation API, which reports the heading in degrees (0° to 360°). The magnetometer senses the Earth's magnetic field just as a needle compass does, and the browser turns that reading into a heading and a cardinal point (N, NE, E, SE, S, SW, W, NW). Because it deals with motion sensors, many mobile browsers only grant access after a tap and an explicit permission, a privacy protection. On desktops and laptops without a magnetometer, the reading simply stays unavailable.
Heading is measured in degrees from north: 0° is north, 90° is east, 180° is south and 270° is west. The cardinal point on screen is just a friendly translation of that angle. As you rotate the device, the number changes continuously because the magnetometer is reading, in real time, where the top of the device points relative to the Earth's magnetic field.
There is an important difference between magnetic north and true (geographic) north: the magnetic field does not point exactly at the geographic pole, and that difference, called magnetic declination, varies across the planet. A phone compass shows magnetic north unless the software applies a correction, which is why it is good for general orientation, not precision navigation.
Example 1, pointing an antenna or panel: if the install calls for the equipment to face north, start the compass, rotate until the heading reads close to 0° (N), and line the object up with the top of the device. For east, look for ~90°; for west, ~270°.
Example 2, finding which way a window faces: standing at the window with the device level and pointing outward, read the cardinal point. If it reads around 180° (S), the window faces south, useful for sunlight, plants or solar panels. Repeat at another time to confirm, since local interference can mislead the reading.
Phone sensors are convenient but prone to interference: magnetic phone cases, metal-framed desks, speakers, chargers and even nearby electronics distort the field and make the heading "jump." For serious navigation, hiking or technical work, a calibrated physical compass is still more reliable.
To improve it: keep the device level, move it away from metal and magnets, and do the figure-eight calibration motion that most systems recognize. The "Absolute" field indicates when the browser managed to reference the orientation to a fixed reference; without it, the heading may be only relative and less reliable.
These references help contextualize formulas, standards, APIs and limitations used on this page. They do not replace professional validation when a result has legal, financial, medical or operational impact.
Only if the computer and browser expose orientation sensors. Most desktops and laptops have no magnetometer, so the compass reading is not available on them.
Orientation is read locally; no sensor data is uploaded.