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

Frequently Asked Questions

20

What is the difference between a public and private IP address?

21

Your public IP is the address the internet sees, assigned by your ISP and shared by all devices on your home network. Your private IP is assigned by your router using DHCP and only identifies your device within your local network. The private one is not routable on the public internet, and your router translates between the two using NAT.

22

What are the private IP address ranges?

23

Private IPs use the reserved ranges defined in RFC 1918: 10.0.0.0 to 10.255.255.255 (Class A), 172.16.0.0 to 172.31.255.255 (Class B), and 192.168.0.0 to 192.168.255.255 (Class C). These addresses are not routable on the public internet.

24

How does NAT translate a private IP to a public IP?

25

When a device on your network (say 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.

26

Does NAT protect my devices like a firewall?

27

NAT provides a basic layer of security because devices behind it are not directly addressable from the internet, but NAT is not a firewall. UPnP, port forwarding, and certain protocols can bypass NAT and expose your devices, so you still need proper router configuration.

28

Why do I have both a public and a private IP?

29

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. The split exists largely because IPv4 only offers about 4.3 billion addresses, so NAT lets many devices share one public IP. IPv6 has enough addresses that every device could have a unique public IP.

30
Published: April 2026