Blog

How to use your phone as a level, ruler and compass

Shadowkit Toolbox: everything it doesLevel, compass, ruler and more

You want to hang a picture straight, see how long a screw is, or work out which way a window faces, and there’s no spirit level, tape measure or compass in the drawer. Your phone can do all three: it has a sensor that feels gravity, one that feels the Earth’s magnetic field, and a screen whose size it knows.

Each one needs a little care to be trusted, though. Here is how a phone level, ruler and compass work, how to check each one, and then how Shadowkit’s Toolbox does it.

A level: gravity on three axes

A phone’s accelerometer measures gravity along three directions: across the screen, up the screen and straight out of it. Lying perfectly flat, all of gravity is straight out of the screen. Tip the phone and some of it moves into the other two, and the angle comes from how much. Stood on its edge, the same sensor tells how far the phone leans from upright.

Two things can fool it:

  • The phone itself. Most phones have a camera bump, so lying on its back the phone rocks or sits at a slight angle. A thick or uneven case does the same. Take the case off, or stand the phone on its long edge instead, which is flat on most phones.
  • The sensor. No two sensors are made exactly alike, and a small offset is normal.

To check a phone level, use the turn-around test. It’s how carpenters check a spirit level, and it needs nothing else:

  1. Lay the phone on the surface and note the reading and which way it’s low in the room, say 0.6° low towards the window.
  2. Turn the phone end to end, 180°, in the same spot, and read it again.
  3. If the two readings agree, the same angle low towards the same side of the room, the phone reads true and the surface tilts by that much. If they differ, count a reading low towards the window as plus and away from it as minus: the surface’s real tilt is the average of the two, and the phone’s own error is half the difference. Readings of 0.6° and then 0.2°, both towards the window, mean the surface tilts 0.4° and the phone is 0.2° out.

Once you know the phone reads true, or you’ve set it to zero on a surface you know is level, it’s good for shelves, picture frames, a washing machine’s feet or a wobbly table. For building work, use a real level.

A ruler: the screen’s size, checked against a card

A phone knows its screen in pixels, and it reports how many pixels there are to an inch. From that, a ruler app can draw millimetres. The trouble is that the number it reports isn’t always exact, and on iPhones apps aren’t told it at all, so they work from the known sizes of Apple’s screens. A ruler a few percent out is enough to make a 5 cm screw read 4.8 cm.

The fix is to calibrate it against something whose size you know exactly, and nearly everyone carries one: a bank card. Payment cards are made to the ISO/IEC 7810 ID-1 size, 85.60 × 53.98 mm (3.370 × 2.125 in), and so are many ID cards and driving licences. Lay the card on the screen, match a drawn outline to its edges, and the ruler is true for that phone.

Measuring then goes the way it does with a wooden ruler: put one end of the object at 0, and read where the other end falls. A phone ruler only reaches as far as the screen, so it’s for small things: a screw, a button, a photo print, the width of a cable.

A compass: magnetic north and true north

A phone’s compass is a magnetometer, which feels the direction of the Earth’s magnetic field. That points to magnetic north, which isn’t the same as true north, the direction of the North Pole along the lines on a map. The angle between them is called declination, and it depends on where you are and drifts from year to year as the Earth’s field changes. In western Europe it’s a few degrees at most today; in parts of North America it’s more than 10°.

Whether that matters depends on what you’re doing. To see roughly which way a garden faces, magnetic north is fine. To follow a bearing from a map, it isn’t: 10° off over a kilometre puts you about 175 metres to one side.

Correcting for it needs two things: where you are, and a model of the Earth’s field. The standard one is the World Magnetic Model, from the US National Oceanic and Atmospheric Administration and the British Geological Survey. It’s revised every five years, and the current one, WMM2025, covers 2025 to 2030. Declination changes only slowly across a region, so the city you’re in or near is close enough for a phone compass.

To get a good reading:

  • Keep away from magnets and metal. Magnetic phone cases and wallet clasps, magnetic car mounts and rings, speakers, laptops, steel desks and the inside of a car all bend the field the phone feels. Take the phone out of a magnetic case and step away from them.
  • Calibrate when asked. If the phone says its compass needs calibrating, move it slowly through a figure 8 in the air a few times.
  • Hold it flat, screen up, for the steadiest reading.

How Toolbox does it

Toolbox is a skill in Shadowkit with seven tools built in: a level, a compass, a ruler, a unit converter, a timer, a stopwatch and a flashlight. Each tool is a card on Toolbox’s page showing its live reading, and a tap opens it.

Level. Choose Flat, a bubble in a circle, or On its edge, a bubble along a bar for standing the phone on any edge. It shows the angle, such as 0.4°, and which way it’s tilted, and says Nearly level within half a degree, in words and with a check, not by colour alone. Hold freezes the reading so you can look at it after taking the phone away. Set zero takes the phone’s reading of the moment as level: do it on a surface you know is level, and later readings count from there. Clear zero undoes it.

Ruler. The scale runs down the left edge of the screen from 0 at the very top, in millimetres or eighths of an inch. Line one end of the object up with 0 and drag the line to the other end; it reads to a tenth of a centimetre or a hundredth of an inch, and the last length stays on the Ruler’s card. Calibrate draws a bank card’s outline standing up in the screen’s top-left corner: lay a card in the corner and use Smaller and Larger until the outline meets its edges, then Save. Use the screen’s own size forgets the calibration.

Compass. It shows the heading in degrees and its point, such as 42° North-east, against magnetic north, and asks for a figure 8 when the phone says its compass needs it. Under True north, choose your city from a list of the world’s capitals and largest cities. Toolbox works out the declination there on your phone from the World Magnetic Model 2025 and shows how far true north is from magnetic north, then reads every heading against true north. It never asks for your location: the city is all it needs, and you choose it.

The rest of the toolbox:

  • Convert turns a number into other units: length, weight, temperature, volume, area, speed and data, in exact arithmetic, with every other unit of the category listed below. There’s no currency, since rates change and Shadowkit works offline.
  • Timer runs one timer at a time, from a preset or your own with a name, like “Tea”, and rings even if you close the app. If the phone needs to ask, the app asks to send notifications the first time you start one, not before.
  • Stopwatch keeps laps and marks the fastest and the slowest, and keeps going if you close the app.
  • Flashlight turns the phone’s torch on and off, in brightness steps on phones that have them. It’s on Android only.

The level and the compass read their sensors only while their card or tool is on the screen and the app is open. Swipe to another page or close the app, and nothing is read.

Private, and free

Toolbox works offline, like the rest of Shadowkit: the app doesn’t have internet access, and there’s no account. It asks for no permission the app didn’t already have; the sensors and the flashlight need none. Nothing it reads is sent anywhere, and the ruler’s calibration, the level’s zero and your city stay on the phone they belong to.

Every tool is free, with no limits. To keep count of something rather than measure it, see what a tally counter app is good for, and for the rest of the app, meet Shadowkit.

Shadowkit Toolbox: everything it doesLevel, compass, ruler, converter, timer and stopwatch, and a flashlight on Android.

Get Shadowkit

Scan with your Android phone’s camera, or tap Google Play. iPhone is coming soon.Tap Google Play to get it. iPhone is coming soon.

iOS

App Store

Android

Google Play