HackMyIP
← back to sheets

Public vs Private IP: What Is the Difference?

~/sheets/public-vs-private-ip.md
1

Two Addresses, One Device

2

Every device connected to the internet has at least two IP addresses: a private IP on your local network and a public IP visible to the outside world. Understanding the difference is fundamental to network security.

3

What Is a Public IP?

4

Your public IP is the address the internet sees. It is assigned by your ISP and shared by all devices on your home network. When you visit a website, the server sees your public IP. You can check your public IP here. Every device behind your router shares this same public address.

5

What Is a Private IP?

6

Your private IP is assigned by your router using DHCP. It identifies your device within your local network. Private IPs use reserved ranges defined in RFC 1918:

7

10.0.0.0 - 10.255.255.255 (Class A)

8
172.16.0.0 - 172.31.255.255 (Class B)
9
192.168.0.0 - 192.168.255.255 (Class C)

10

These addresses are not routable on the public internet. Your router translates between private and public addresses using NAT (Network Address Translation).

11

How NAT Works

12

When your laptop (private IP 192.168.1.5) requests a webpage, your router replaces the source address with your public IP and keeps a translation table. When the response arrives, NAT routes it back to the correct device. This is why multiple devices can share one public IP.

13

Why This Matters for Security

14

NAT provides a basic layer of security: devices behind it are not directly addressable from the internet. However, NAT is not a firewall. UPnP, port forwarding, and certain protocols can bypass NAT and expose your devices. Use IP Lookup to investigate any IP you encounter.

15

IPv4 vs IPv6

16

The public/private distinction exists primarily because IPv4 only offers about 4.3 billion addresses. IPv6 provides enough addresses that every device can have a unique public IP, potentially eliminating the need for NAT. However, this also means every device becomes directly addressable, which introduces new security considerations.

17

Key Takeaway

18

Your private IP stays hidden from the internet. Your public IP is visible to every server you connect to. Protect your public IP with a VPN and keep your local network secure with proper router configuration. Run our port scanner to check for exposed services, and use the WebRTC leak test to ensure your private IP is not leaking through your browser.

19
Last updated: April 2026