As you're reading this, you probably know what a VPN does – you may even use a VPN service – but if you’re wondering how they work, we have the answers you’re looking for. In case you don't know what a VPN is for, here it is in a nutshell: a VPN hides your real location and identity to allow you to use the web anonymously and privately. It can also change your location to a different country and allow you to access content that's only accessible to those located in that country or region.

How does a VPN change my location?

When you press the 'Connect' button in your VPN app, it typically uses the fastest available server. This might be in the same country (but in a different city) or it could be in another country. Usually you can also choose a location manually, which allows you to pretend to be in a country of your choice. 

As there are different reasons to use a VPN, such as watching BBC iPlayer when abroad, you might choose a server in your home country or you might pick one in a different country to get around blocked content.

Whichever you choose, your internet connection is routed out through your ISP (internet service provider) and then via your chosen VPN server to the final destination, typically a website.

As part of this process, your IP address - the sequence of number assigned to you by your normal internet provider - is replaced with a new one from the VPN server. IP addresses are much like postcodes (or zip codes, if you prefer) in that they represent a certain physical location. So changing your IP address is the same as changing your location.

This means that the website you're visiting sees the IP address from the VPN server, not your real address, so it can appear that you’re located in California or New York when you’re actually in Paris or London.

How does a VPN work?

How does a VPN keep my data private?

As you can see in the image above, the connection between your computer and the VPN server is encrypted. That means that anyone (even your ISP) attempting to look at the data being sent to and from your computer will find that they can’t because none of it is sent as plain text.

Only your computer and the VPN server have the encryption and decryption keys. When the data arrives at the VPN server it is decrypted and sent on to the website or other server as appropriate.

That information can still be encrypted, just as when you visit a secure website without using a VPN, but whether it is encrypted or not will depend on the site or service you’re using.

You can tell if it's encrypted if the website address begins with HTTPS. You should see this in the address bar of your web browser along with a padlock symbol.

Also, if you use Gmail and send an email to another Gmail user, the message is encrypted for its entire journey. When you use a VPN service as well the data is encrypted a second time, but only between your computer and the VPN server.

All of this happens transparently and automatically: the only downside to a VPN is that the speed of the connection could be a bit slower than when you connect to the internet normally.

Speed depends on many factors, but if you’re downloading videos using a VPN, it could take significantly longer than without one, which is why it's a good idea to subscribe to a VPN that's known for its fast servers, or choose a server that's as close to your real location as possible.

If you're specifically looking for the ultimate in privacy and security, read our guide to the Most Secure VPN.

Does a VPN affect every app on my computer?

It depends. Usually it does because you’ll download an app from your VPN provider, sign in with your account details, pick a server and then turn on the VPN connection. You can see this in the NordVPN screenshot below. Nord is one of our recommended VPN services, but you can find more in our roundup of the best VPNs.

How does a VPN work?

Connecting in this way affects every app on your computer (or phone or tablet if you're running one of the mobile apps) which connects to the internet, including web browsers, games and even system updates.

There are some VPN services that require no software at all. For example, Hidden24 works with each operating system's native VPN settings so you enter your account and server details and you can use it on Windows, Linux, iOS, MacOS and Android. Again, this means that everything that connects to the internet goes via that encrypted connection.

However, if you use a web browser with a built-in VPN (such as Opera) or you install a browser add-on in Chrome, Firefox or another one, then only data sent to and from that browser will be affected by the VPN. Any other app (including other web browsers) will use the normal, unprotected connection. This approach has pros and cons. The advantage is that you can securely browse with a VPN, but not slow down the connection speed for other apps.

The disadvantage is that you might forget that other apps and browsers won’t use the VPN connection and won’t be afforded the same protection. Also, some browser extensions are merely proxy connections, which aren't as secure as a VPN.

Does a VPN protect all my devices?

It’s worth noting that you’ll have to install the VPN software on every computer or device. The only workaround to avoid having to do  device individually is to buy a router that supports VPN connections – you’d then enter your login details into the router’s interface which would then apply the encryption to every device that connects to the internet.

There are again pros and cons of this method. The VPN connection would be used permanently for every device, which may cause problems. For example, if you’re trying to stream video through a set-top box, the connection speed via the VPN may be too slow and be forever stopping to buffer.

The advantage is that your smart home devices (security cameras, smart speakers etc) also benefit from the VPN encryption, which should mitigate any security holes they may have. Typically there’s no other way to use a VPN with such devices.

Just remember that the VPN router method applies only when devices are connecting via the router. Phones and tablets must be connected via Wi-Fi: when they connect via 3G or 4G, the VPN connection won’t be used.

To see a list of the providers we recommend, check out our guide to the best VPN services.

Related articles for further reading