Not unless they serve a formal notice under section 49 of the Regulation of Investigatory Powers Act 2000 (RIPA), or you are being examined at a port or airport under terrorism powers. In any other situation, you can decline, and declining is not an offence.

Being asked

If officers seize your phone or computer they will usually ask for the passcode or PIN. This is a request, and you do not have to agree. You can say that you would like to speak to a solicitor before answering any questions, including that one. Officers cannot hold you in contempt (that is a power of courts, not the police) and refusing a request does not justify extra force or a longer detention.

Being ordered

Section 49 of RIPA allows the police to serve a written notice requiring you to disclose a password, PIN or encryption key. The notice must be authorised by a judge in most cases, and the police must have reasonable grounds to believe:

  • The key is in your possession.
  • Disclosure is necessary for preventing or detecting crime, in the interests of national security, or for the economic well-being of the UK.
  • Disclosure is proportionate.
  • The information cannot reasonably be obtained any other way.

The notice must be in writing, describe the protected information, give you a time limit, and tell you the consequences of not complying. Failing to comply is an offence under section 53 carrying up to two years' imprisonment (five years in national security and child indecency cases). You should not say anything about a section 49 notice until you have spoken to a solicitor. Read our full guide to Section 49.

What if you genuinely don't know it?

The law cannot make you remember something you have forgotten. If you are prosecuted under section 53, and there is enough evidence to raise the possibility that you did not have the key, the prosecution has to prove beyond reasonable doubt that you did. In practice courts look at how recently you used the device and how plausible the forgetting is. Changing your password regularly and not knowing the current one after months in police storage is a real scenario; claiming to have forgotten a code you used an hour earlier is unlikely to convince anyone. Lying to the police about it could amount to perverting the course of justice.

Ports and airports

Under Schedule 7 of the Terrorism Act 2000, an examining officer at a port can require you to hand over devices and the means to access them, without any suspicion. Wilfully failing to comply is an offence punishable by up to three months' imprisonment. This power only applies at borders.

Face and fingerprint

There is no clear power to force you to look at or touch your phone to unlock it, but there is also no case law that says officers cannot. If this concerns you, disable biometric unlock when you expect contact with the police; both iOS and Android have a quick way to do this.

In short

  • A request for your password: you can refuse, and should take legal advice first.
  • A section 49 notice: take urgent legal advice; refusal is a crime.
  • A border examination: refusing is an offence.
  • Never lie about it or destroy data: both are offences in their own right.

This is general information for England and Wales, not legal advice. If you have been arrested or charged, speak to a solicitor: advice at the police station is free for everyone.