Photo code for digital passport photos

Photo booths and shops can give customers a photo code with their printed photos.

When customers apply for a UK passport online, they enter the code to retrieve their digital photo. The photo is added directly to the passport application. His Majesty’s Passport Office check that all photos meet the rules for UK passports.

This guide gives advice for photo suppliers on how to provide the photo code to customers, and technical instructions for establishing the service.

How to provide the photo code to customers

To enable your customers to use this service, you need to:

  • host your digital passport photos securely on the internet
  • convert the full HTTPS internet address (URL) into a shortened version
  • provide the shortened internet address (URL) to customers and describe it as a photo code
  • provide details of how customers can contact you if there’s a problem with their digital photo

Technical instructions for establishing the service

You will need to establish a secure process for uploading, storing and transferring your customers’ digital photos on a publicly accessible host on the internet.

The digital photo must:

  • be a JPEG between 50KB and 10MB - the ideal image size is 3MB (it must be possible to retrieve the photo in less than 30 seconds)
  • meet the rules for digital passport photos.

A short URL must be provided to the customer in the format of sub-domain (1-6 characters), top-level-domain (2-3 characters), and path (6-8 characters), for example: photo.co/yh8Y6K2s

The short URL must use HTTPS and must either return a JPEG image, or a redirect to a JPEG image, not a webpage or CAPTCHA.

A JSON Web Signature (JWS) token will be sent with each request in the Authorization header. This signature should be authenticated using our published public key to restrict photo retrieval to His Majesty’s Passport Office only.

The ‘sub’ in the JWS token is the HTTPS short URL of the photo code (for example: https://photo.co/yh8Y6K2s) and should be verified.

Photo code example