You looked up your IP address in your computer's settings, then typed it into a support form or a firewall rule, and it didn't work. That usually happens because a device on a home or office network has two addresses. Your router gives it a local address, usually starting with 192.168. or 10., and the whole network shares one public address that websites see.
The settings screens and commands on your device show the local address. The quickest way to see the public one is to open What is my IP in a browser. The rest of this guide shows both, for each operating system.
Public IP or local IP: which one do you need?
| You want to | You need |
|---|---|
| Set up port forwarding, connect to a printer or NAS, reserve an address on the router | Local IP |
| Give your address to a support team, add it to an allowlist or firewall rule | Public IP |
| Check whether your address is on a blocklist | Public IP |
| Restrict an API key to your server or office | Public IP |
| Troubleshoot two devices on the same Wi-Fi that can't see each other | Local IP |
The local address comes from the private ranges set aside in RFC 1918: 10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16. Those ranges are reused in millions of homes, so a local address means nothing outside your network. Your router translates between the two (NAT), which is why every device in the house shows the same public IPv4 address to websites. Public vs private IP addresses explains the difference. If you're new to the terms, what is an IP address covers the basics.
Find your public IP address (any device)
Open What is my IP on the device. It shows the address the page was loaded from, plus its approximate location, ISP, network (ASN) and time zone. It works the same on a phone, a laptop or a smart TV browser.
Many connections now have both an IPv4 and an IPv6 address, and a browser picks one of them for each site, usually IPv6 when both work (IPv4 vs IPv6 compares the two). What is my IPv6 shows whether your connection has working IPv6; not having it is common and not a fault. What is my IPv4 shows your IPv4 address only when your browser reaches it over IPv4, so on a connection with both it may say the IPv4 address isn't visible. With an API key, the curl -4 command below gives you the IPv4 one.
On a server with no browser, any "what is my IP" service that returns plain text will do. With an IPAPI.GR key (free plans include one), the /api/lookup/self endpoint returns the caller's own address along with the same location and network fields as any other lookup:
curl "https://ipapi.gr/api/lookup/self?key=YOUR_API_KEY"Add -4 or -6 after curl to force IPv4 or IPv6, which shows the machine's public address in each family, or an error if it has none.
Windows 11 and 10
Microsoft's page Essential network settings and tasks in Windows gives the same steps for Windows 11 and Windows 10:
- Open Start, then Settings, then Network & internet.
- Select Wi-Fi and then the network you're connected to, or select Ethernet for a cable connection.
- Your local address is listed next to "IPv4 address".
From a terminal, run ipconfig in Command Prompt or PowerShell. Without parameters it lists the IPv4 and IPv6 addresses, subnet mask and default gateway for every adapter (Microsoft ipconfig reference). Look for the adapter you're using, such as "Wireless LAN adapter Wi-Fi":
Wireless LAN adapter Wi-Fi:
IPv4 Address. . . . . . . . . . . : 192.168.1.23
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . : 192.168.1.1The "Default Gateway" is your router's local address, which is the address you type into a browser to open the router's settings. In PowerShell, Get-NetIPConfiguration lists each connected adapter with its IPv4 and IPv6 addresses, default gateway and DNS servers (the IPv4Address, IPv4DefaultGateway and DNSServer lines).
macOS
On macOS 13 Ventura and later, Apple's guide Enter TCP/IP settings on Mac gives this path:
- Choose Apple menu > System Settings, then click Network in the sidebar.
- Click the network service you're using (Wi-Fi or Ethernet), then click Details.
- Click TCP/IP. The IP address, subnet mask and router are listed there.
In Terminal:
ipconfig getifaddr en0en0 is usually the Wi-Fi interface on a MacBook. On a Mac with built-in Ethernet, en0 is often the Ethernet port and Wi-Fi is en1. If the command prints nothing, try the other one, or run networksetup -listallhardwareports to see which name belongs to which port.
Linux
The ip command from iproute2 is on almost every current distribution (ip-address(8)):
ip -brief addressIt prints one line per interface with its addresses in CIDR form:
lo UNKNOWN 127.0.0.1/8 ::1/128
wlp2s0 UP 192.168.1.42/24 2001:db8:1234:5678::42/64 fe80::1c2d:3eff:fe4f:5a6b/64Ignore lo (the loopback interface) and addresses starting with fe80:, which are link-local and only work on the local network segment. ip addr show gives the long form. On Debian and Ubuntu, hostname -I prints just the addresses, space-separated.
Desktop environments also show the address in their network settings, usually in the details of the connected network.
Android
Menu names differ between phone makers and Android versions, so treat this as a guide. On Google Pixel phones, Google's help page on advanced network settings gives the path to a network's settings:
- Open Settings, then Network & internet, then Internet.
- Tap the gear icon next to the Wi-Fi network you're connected to.
The IP address is among that network's details, often under a "Network details" heading.
On Samsung Galaxy phones, the most reliable place is Settings > About phone > Status information, which lists the current IP address. Most other Android phones have the same list under Settings > About phone > Status, and many also show the address in the connected Wi-Fi network's details.
On mobile data, the settings screens often show nothing useful. Many carriers give phones a private or shared address behind carrier-grade NAT, or an IPv6-only address, so the number on the phone isn't the one websites see. Use What is my IP in the browser instead.
iPhone and iPad
- Open Settings and tap Wi-Fi.
- Tap the info button (the small "i") next to the network you're connected to (Apple: Manage Wi-Fi settings on iPhone).
- Scroll down to the IPv4 Address section. The "IP Address" line is your local address, and "Router" is the router's.
The same screen has a "Private Wi-Fi Address" setting, which on iOS 18 and later can be Off, Fixed or Rotating, and also shows a MAC address. The setting and the MAC address shown on that screen are about the hardware identifier your device uses on that network, and have nothing to do with your IP address (Apple: Use private Wi-Fi addresses). If you've turned on iCloud Private Relay, websites you open in Safari see a relay address, so the public IP shown in Safari can differ from the one other apps use.
Chromebook (ChromeOS)
Google's Chromebook Wi-Fi help (Find your MAC address or IP address) gives these steps:
- Select the time at the bottom right of the screen.
- Select the Wi-Fi network you're connected to.
- Select the Information icon (the small "i") at the top. Your IP address and IPv6 address are listed there.
On your router: the WAN address
Your router has its own public-facing address, usually called the WAN or internet address. Open the router's admin page (the default gateway address from the sections above, often 192.168.1.1 or 192.168.0.1) and look for a status or internet page.
Compare that WAN address with your public IPv4 address. What is my IPv4 shows it when your browser connects over IPv4; on a connection that also has IPv6, use the curl -4 command with your API key from the public IP section instead.
- If they match, your router has the public address and port forwarding will work.
- If the WAN address is in
100.64.0.0/10(anything from100.64.0.0to100.127.255.255), your ISP has put you behind carrier-grade NAT. RFC 6598 reserves that range as shared address space for exactly this. You share a public address with other customers, and incoming connections can't reach you without help from the ISP. - If the WAN address is a private
192.168.x.xor10.x.x.xaddress, there's another router in front of yours, either your ISP's modem in router mode or a second router in the house. Some ISPs also use private ranges on the WAN side, so check the modem before you blame the ISP.
If you need a visitor's IP in your own app
Reading the client address in server code is a different problem: behind a load balancer or CDN, the socket address is the proxy's, not the visitor's. Get the client IP in Express behind a proxy covers it for Node.js.
FAQ
Why is my IP address different on my phone and my laptop?
On the same Wi-Fi, each device gets its own local address from the router, so those differ by design. Their public IPv4 address should be the same. If the phone is on mobile data, it uses the carrier's network and gets a completely different public address. A device that uses IPv6 also has its own public IPv6 address, because IPv6 normally doesn't use NAT.
Why does my IP start with 192.168 or 10?
You're looking at your local address. 192.168.0.0/16, 10.0.0.0/8 and 172.16.0.0/12 are private ranges (RFC 1918) that only work inside your network. The address websites see is on What is my IP.
Why does the IP in my router not match the one websites show?
Either there is another layer of NAT between your router and the internet (carrier-grade NAT at your ISP, or a second router), or your browser is connecting over IPv6 and you're comparing that with the router's IPv4 address. Compare IPv4 with IPv4: What is my IPv4 shows your public IPv4 address when your browser reaches it over IPv4.
How do I find another device's IP on my network?
The router's admin page usually lists connected devices with their local addresses, often under "attached devices" or "DHCP clients". On the device itself, look in its network settings, as described for each operating system in this guide. Printers and TVs often show their address in a network settings or status page.
Next: see what your public address reveals with What is my IP, or look up any other address on IP lookup.