The iPhone’s built-in Compass app is probably one of those apps that most people simply tuck away into a folder and generally forget about, but it’s actually got a pretty handy feature hidden inside, allowing you to essentially use your iPhone’s built-in accelerometer as a level.

While third-party apps have existed for this purpose pretty much since the iPhone came out, the built-in Compass app actually eliminates the need to bother with other apps. Simply open the Compass app and swipe from right to left and you’ll be presented with one of two different leveling views, depending on how you’re holding your iPhone.
Lay the iPhone relatively flat, and you get two circles that will move farther apart or closer together along two axes depending on how perfectly horizontal the iPhone is laying – useful for leveling a table, for example. On the other hand, if you hold the iPhone at more than a 45 degree angle, you’ll get a horizon indicator instead to help illustrate how much your iPhone is tilted to either the left or right.
The app defaults to true level, however you can also match an existing slope by holding the iPhone against the surface you want to match and then tapping the screen to capture that as the current slope. In this mode, deviation will be shown in red instead of green, and the desired slope will be illustrated in black.