Sensor / 03

Spirit level.

Lay your phone flat on the surface, screen up. The bubble drifts toward the high side. Pitch is forward-back tilt, roll is side-side. Zero-calibrate against a known-flat reference for best accuracy.

Notes

Source: DeviceOrientationEvent beta (pitch) and gamma (roll), both in degrees. Bubble position is proportional to roll within ±15°. Zero button stores an offset locally for this session only.

Enable motion sensors

iOS requires permission. Android starts automatically.

Pitch (β)
—
Roll (γ)
—
Horizontal vial
—
Frequently asked

How accurate is a phone spirit level?

Modern phones use a 3-axis accelerometer fused with the gyro to compute pitch and roll. On a still surface, expect ±0.2-0.5° accuracy — close enough to hang a picture, tile a small backsplash, or check a tabletop. A real bubble level is ±0.5°; a precision machinist's level is ±0.02°. For carpentry, framing, and most DIY, your phone is fine. Use the zero-calibration button if your phone case has a slight tilt.

Why does my phone read non-zero on a flat table?

Your phone case probably isn't truly flat — most have raised camera bumps, rounded edges, or rubber feet that shift weight. Tables aren't perfectly level either. Use the Zero button while the phone sits on the surface you're calibrating against — that captures the offset and subtracts it from subsequent readings, so the bubble reads true relative to that surface.

Should I use the back, the screen, or the long edge?

Lay the phone flat on its back (screen up) to measure pitch (forward-back tilt) and roll (side-side tilt) of a horizontal surface. Stand it on the long edge against a wall to measure if the wall is plumb. The bubble vial in this tool shows roll — tilt the phone left/right to see it move. The numeric pitch and roll are independent of orientation.

How is this different from the plumb-bob tool?

Spirit level checks horizontal surfaces (tables, shelves, floors). Plumb-bob checks vertical surfaces (walls, door frames). The math is the same — gravity vector versus device axes — but the reference axis differs. Use /sensor/plumb for walls and /sensor/level for floors and tabletops.

Does this work on a laptop?

Only on convertibles and 2-in-1s that expose an accelerometer for screen rotation. Standard laptops and desktops will sit at the prompt — DeviceOrientation events never fire. This is a phone tool. Open the page over HTTPS on a phone, tap Enable on iOS, and lay it flat.

Will this work without internet once loaded?

Yes — the page is a single HTML+JS file with no remote calls during measurement. Once the page is open, you can put your phone in airplane mode and the level keeps working. Useful in basements, attics, or remote job sites without signal.