My iPhone's off button - the power-off button, lock button or whatever you call the button at the top of the iPhone - has stopped working. You have to press it hard three or four times to get it to work. Is there a fix for this, or a way to avoid having to use it?

iPhone or iPad lock/power button not working? Here's how to fix a broken lock button 

The button at the top of my iPhone 4S, commonly known as the lock button, power button, sleep button or off button, is broken. It doesn't click at all. This can be really, really annoying because you can't turn off the iPhone, you can't take a screenshot, and, most frustratingly, you can't put your iPhone to sleep.

It's clear that this is a common problem, and Apple has even been taken to court over it. Two iPhone owners in the US attempted to sue Apple over the problem, which they say is caused by a faulty design.

In their complaint, which was filed in February 2013, the two plaintiffs say that Apple knew that there was a problem with the iPhone 4 and iPhone 4S' lock button design. They also say that the apparent fault could be hazardous because it prevents users from being able to turn off their phones on a flight, for example. 

US District Judge Gary Feess threw out the power button case, though, dismissing the claim because the plaintiffs failed to prove a breach of warranty and RICO.

In May, a nearly identical case was filed against Apple, in which the plaintiff argues that the flex cable mechanism attached to the power button, which we've found is the cause of the problem, becomes inoperable after extended use.

Do you have an older iPhone? Find out how to unlock your iPhone 4 here.

iPhone 5 Sleep/Wake Button Replacement Program

If you're using an iPhone 5, you'll be pleased to hear that Apple offers a replacement programme for the power button. On 25 April 2014, the company confirmed that some iPhone 5 smartphones have defective power buttons and has offered a free replacement.

“Apple has determined that the sleep/wake button mechanism on a small percentage of iPhone 5 models may stop working or work intermittently,” Apple said in an online support document.

It's good to hear that Apple is addressing the issue, but we're disappointed that the replacement is only offered to iPhone 5 owners, as we've experienced the issue with iPhone 4 and iPhone 4s models too.

If your power button is broken (and judging by the amount of people that read this article every day, that's a lot of you), and it's not an iPhone 5 eligible for a replacement from Apple, we feel your pain. However, you'll be glad to find out that it is kind of fixable, and there's a really handy workaround that you might not know about. 

Broken Home button? There's a fix for that too: How to fix a broken Home button.

How to fix a broken iPhone lock button: Hardware repair

If your iPhone is still in warranty, Apple may be able to repair the hardware for free. Check out our iPhone warranty guide to see what your rights are. You can make an appointment with Apple to find out if you're covered. If it turns out you're not covered, a Genius from the Apple Store will be able to tell you how much it'll cost to get it repaired.

If you're not happy with coughing up the cash to get your iPhone's lock button repaired, or if your bank balance won't allow it, you could consider repairing the iPhone yourself.

We wouldn't recommend trying to repair your iPhone yourself unless you're confident in doing so, as it's really quite difficult. Plus, it's not as simple as getting a new lock button and fitting that in - it could actually be that there's a tiny part missing from the power button flex cable. Unfortunately, this is one of the last components to be removed from the iPhone during repair, so you'll need to do a lot of fiddly work before you get to it.

Also, attempting to repair your iPhone yourself could invalidate your warranty, so if it doesn't work and you end up having to take it to Apple, it's likely you'll have to pay.

Here's how to reset and restore a frozen iPhone

How to fix a broken iPhone lock button: the software solution

In iOS, there's a little known feature that can help massively when buttons stop working on your iPhone.

To get to this feature, go to Settings > General > Accessibility. There, scroll down to click AssistiveTouch and slide the toggle so that it appears green.

Now, a grey square with a white circle inside will appear on your screen. You can drag this little square anywhere you prefer. It's disruptive pretty much anywhere on your screen, but we found that the bottom third of the right hand side of our screen was the best for us.

Plus, if you find the AssistiveTouch button super annoying, you can go to Settings > General > Accessibility > Accessibility Shortcut and then choose AssistiveTouch. Now, clicking the Home button three times in quick succession will make the AssistiveTouch button disappear. Triple-click again and it'll reappear.

Pressing the circle will bring up a menu with four different options to choose from: Siri or Voice Control (depending on which model of iPhone you own), Device, Home and Favourites.

To access the lock button, tap device, and then tap Lock Screen.

How to take a screenshot on an iPhone with a broken lock button

This won't enable you to take a screenshot, but pressing More and then Screenshot will. The plus is that the AssistiveTouch menu and button won't be present in your screenshot (hence our photographs in this article).

How to turn off an iPhone with a broken lock button

You can turn off your iPhone even if the lock button is broken, too. To do so, tap the grey accessibility button, tap device and then tap and hold Lock Screen. This will bring up the usual power off screen so you can then slide to power off.

Dont't forget, though, if you turn off your iPhone with a broken lock button then you won't be able to turn it back on unless you plug it into your computer or mains adaptor.

While this might sound like an annoying workaround at first, we found that after a few hours, it became second nature to lock our iPhone using the feature.

Of course, the other way around the broken lock button is to get yourself an upgrade. Apple's iPhone 5s and iPhone 5c are the latest models available.

See also: How to repair a cracked iPhone screen; 5 fixes for a broken smartphone display