Local IP Address: How to Find It and How It Differs From Your Public IP

Updated

Short answer

A local IP address, also called a private IP address, is the address your router assigns to each device on your network, such as 192.168.1.23 or 10.0.0.5. It works only inside your network, so websites never see it; they see your router’s public IP, which the box on this page shows. You find your local IP in your device’s Wi-Fi or network details, or by running ipconfig on Windows.

On this page

Every device on your Wi-Fi or office network has a local IP address, assigned by the router and valid only inside that network. Online, all those devices share the router’s public IP. Here’s where each device shows its local IP, how the two addresses differ, which ranges are local, and which addresses people mistake for one.

Your public IP address

216.73.216.128

Location
Columbus, Ohio, United States
Provider
Anthropic, PBC (AS16509)
Time zone
America/New_York (UTC−4)
Coordinates
39.96, -83.00

This is the address websites see, and the location is an estimate that can be off by a city or more. Your device's local IP (often 192.168.x.x) is a different one and only works inside your network.

Note

The box shows your public IP, the address websites see when you connect. No website can show your local IP, this one included, because that address never leaves your network. With a VPN or iCloud Private Relay on, the box shows that service’s address instead.

How to find your local IP address

Look in your device’s network details for IPv4 address or IP address. The Default Gateway, Router or Gateway entry next to it is your router’s local IP, not your device’s.

DeviceWhere to find the local IP
WindowsRun ipconfig in Command Prompt and read IPv4 Address. On Windows 11, you can also open Settings > Network & internet > Properties.
MacApple menu > System Settings > Wi-Fi > Details next to your network, or run ipconfig getifaddr en0 in Terminal.
iPhone and iPadSettings > Wi-Fi > More Info (i) next to your network > IP Address.
AndroidPixel: Settings > Network & internet > Internet > gear icon next to your network. Samsung: Settings > Connections > Wi-Fi > gear icon.
LinuxRun hostname -I or ip -4 addr in a terminal.
ChromebookSelect the time > your Wi-Fi network > Information (i).
Every device on your networkYour router’s admin page or app, under a name such as Connected devices, Client list or DHCP clients.

Step-by-step guides: find your IP address on Windows, on a Mac, on Linux, or on iPhone, Android and Chromebook. To see every device, find your router’s IP address and open its device list.

If a computer lists several addresses, use the one for your Wi-Fi or Ethernet adapter, not a VPN or virtual adapter.

Local vs public IP address: what’s the difference?

Your internet provider gives your router one public IP address. The router then uses DHCP (Dynamic Host Configuration Protocol) to give each device its own local IP, also called a private IP, from a reserved range.

Local (private) IPPublic IP
Example192.168.1.23203.0.113.42
Assigned byYour router, through DHCPYour internet provider
Seen byDevices on the same networkEvery website and online service you use
UniqueOnly within your network; millions of networks reuse the same addressesOn the internet, though some providers share one address among customers (CGNAT)
Can change whenA device rejoins after its lease runs out, or the router is resetYour provider reassigns it, often after a router restart or an outage
Shows your locationNoApproximately: country, region, sometimes city

How NAT connects your local and public IP

When your laptop at 192.168.1.23 opens a website, the router swaps the laptop’s local address for its public IP and notes which device asked. When the reply arrives, the router passes it back to the laptop. This network address translation (NAT) is why all your devices appear online with the same public IPv4 address.

Local IP address ranges for IPv4 and IPv6

Local IPv4 addresses come from three blocks that RFC 1918 reserves for private networks. Internet providers don’t route them, so every home and company can reuse them.

RangePrefixAddressesWhere you’ll see it
10.0.0.0–10.255.255.25510.0.0.0/816,777,216Company networks, some providers’ home gateways (10.0.0.x)
172.16.0.0–172.31.255.255172.16.0.0/121,048,576Company networks, containers and virtual machines
192.168.0.0–192.168.255.255192.168.0.0/1665,536Most home routers (192.168.0.x or 192.168.1.x)

Only 172.16 through 172.31 is private; other addresses that start with 172 are public.

IPv6 has two kinds of local addresses:

  • Unique local addresses come from fc00::/7 (RFC 4193). In practice they start with fd, followed by a random network ID. Many home networks don’t use them.
  • Link-local addresses start with fe80. Every IPv6 interface has one, and it works only on the directly connected network. A suffix such as %en0 or %12 names the interface.

Most devices on IPv6 also have a global address, usually starting with 2 or 3. That one is public: websites see it when you connect over IPv6.

Special addresses that aren’t your local IP

Some addresses look local but mean something else; the IANA special-purpose address registry lists every reserved IPv4 block.

AddressWhat it isWhat it means for you
127.0.0.1 (localhost), ::1LoopbackThe device itself; traffic sent there never leaves it.
169.254.x.xIPv4 link-local, self-assignedNo answer from the router’s DHCP server, so no internet access.
169.254.169.254Cloud instance metadata serviceAnswers only inside cloud virtual machines, such as on AWS and Microsoft Azure.
100.64.0.0–100.127.255.255Shared address space for carrier-grade NATYour provider shares one public IPv4 address among customers.
0.0.0.0“No address” or “any address”A device showing it has no IP yet; a server listening on it accepts connections on all its addresses.
192.168.0.1, 192.168.1.1, 10.0.0.1Common router defaultsUsually your router (the default gateway), not your device.

Your IP starts with 169.254: the device got no address

The device got no answer from the router’s DHCP server and picked an address from 169.254.1.0 to 169.254.254.255 itself; Windows calls this Automatic Private IP Addressing (APIPA). Reconnect to Wi-Fi or replug the cable, restart the router, then request a new address; on Windows, run ipconfig /release and then ipconfig /renew. If every device shows a 169.254 address, check that DHCP is turned on in the router. The guide to the 169.254 IP address has fixes for each device and the router.

100.64.x.x on your router: carrier-grade NAT

If your router’s internet (WAN) address is between 100.64.0.0 and 100.127.255.255, your provider uses carrier-grade NAT (CGNAT) and puts several customers behind one public IPv4 address. RFC 6598 keeps this shared range separate from the private ranges, and it isn’t public either: websites see your provider’s address. Browsing works as usual, but port forwarding from the internet usually won’t work over IPv4. Ask your provider for a public IPv4 address, or use IPv6.

Why websites can’t see your local IP

Your router’s NAT replaces your local address with the public one, so a website’s server only ever receives the public IP. Location lookups don’t work for a local IP either, since millions of networks use 192.168.1.23 at the same time. Your public IP does reveal roughly where you are and which provider you use; what an IP address tells about you explains the limits.

Browsers once leaked the local IP through WebRTC, the browser feature behind video calls. Chrome started replacing it with a random name ending in .local (an mDNS hostname) in 2019, and current versions of Chrome, Edge, Firefox and Safari do this by default. A site you allow to use your camera or microphone may still see the real address. Since version 142, Chrome also asks for your permission before a site can send requests to devices on your local network.

Over IPv6, websites see your device’s global address, never the ones starting with fe80 or fd.

Is it safe to share your local IP address?

Generally, yes. A local IP is useful only inside your own network: nobody on the internet can connect to 192.168.1.23 in your home, because internet routers don’t forward private addresses. At most, it shows which range your router uses. Your public IP reveals more, and a port-forwarding rule in your router is what opens a local device to the internet.

A 192.168.x.x or 10.x.x.x address in your router or firewall log almost always belongs to a device on your own network. In an email header, it comes from an internal network the message passed through, usually the sender’s. A WHOIS lookup of these ranges names IANA because IANA reserves them for everyone, not because IANA contacted you.

Why your local IP changes, and how to keep it the same

Your router hands out local IPs on a lease. By default, a device renews its lease halfway through, and routers try to give a returning device its previous address, so a device you use daily rarely gets a new IP. It changes when:

  • the device stays offline past its lease and the router gives the address to another device
  • the router is reset or replaced
  • your phone’s private Wi-Fi address (a randomized MAC address) rotates, so the router sees a new device

To keep one local IP for a printer, camera, game console or port-forwarding rule, set up a DHCP reservation (also called an address reservation) in your router. It ties the address to the device’s MAC address. On a phone, set the private Wi-Fi address for your home network to Fixed (iPhone, iOS 18 and later), or have Android use the device MAC for that network, so the reservation keeps matching. The static IP address guide explains when you need a fixed address and how to set one.

Tip

Reserve the address in the router rather than setting a fixed IP on the device. If you set one on the device, pick an address outside the router’s DHCP range, or the router may give it to another device too.

Two devices with the same local IP address

The same local IP on different networks is normal: your laptop can be 192.168.1.23 at home and at a friend’s house. Overlapping ranges cause trouble only when two networks are joined, for example when a work VPN uses the same 192.168.1.x range as your home network.

Two devices with the same IP on one network is an IP address conflict. One or both lose their connection, and your computer may warn that another device is using its IP address. To fix it:

  1. Reconnect or restart the affected device so it requests a new address.
  2. Check your router’s device list to see which devices share the address.
  3. Switch any device with a manually set IP to automatic (DHCP), or reserve an address for it in the router.
  4. With a second router, let only one hand out addresses; set the other to access point or bridge mode.

How to get your local IP address in code

A computer can have several local IPs, one per adapter (Wi-Fi, Ethernet, VPN, virtual machines). You usually want the address of the interface your traffic leaves through. This Python snippet asks the operating system for it without sending any packets.

Python
import socket

def local_ip():
    # Connecting a UDP socket sends no packets. The OS only picks the
    # interface and source address it would use to reach the internet.
    with socket.socket(socket.AF_INET, socket.SOCK_DGRAM) as s:
        s.connect(("192.0.2.1", 80))  # reserved documentation address
        return s.getsockname()[0]

print(local_ip())  # e.g. 192.168.1.23

In Node.js, list the interfaces and skip internal ones such as loopback:

JavaScript
import os from "node:os";

for (const [name, addresses] of Object.entries(os.networkInterfaces())) {
  for (const a of addresses) {
    if (a.family === "IPv4" && !a.internal) console.log(name, a.address);
  }
}
// e.g. en0 192.168.1.23

Don’t look up the computer’s own hostname instead: on Debian and Ubuntu, that often returns 127.0.1.1, a loopback address.

On a home network, neither method returns your public IP, because the router holds it. The info endpoint of our IP lookup API returns the caller’s public IP when you leave out the ip parameter; a free API key works:

Shell
curl -H "apikey: YOUR_API_KEY" "https://api.iplookupapi.com/v1/info?fields=ip"

Frequently asked questions

How do I know my local network IP?

Open your device’s network details. On Windows, run ipconfig and read IPv4 Address; on a Mac, open System Settings > Wi-Fi > Details; on an iPhone, tap the More Info (i) button next to your Wi-Fi network; on Android, open the settings of your Wi-Fi network. A local IP usually starts with 192.168, 10, or 172.16 to 172.31. Your router’s list of connected devices shows the local IP of every device on the network.

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

Your internet provider assigns the public IP address to your router, and every website you visit sees it. Your router assigns a private (local) IP address to each device on your network from reserved ranges such as 192.168.0.0 to 192.168.255.255, and nobody on the internet can reach a device by that address. Network address translation (NAT) in the router lets all your devices share the one public IPv4 address.

Is 127.0.0.1 a local IP?

127.0.0.1 is the loopback address, also called localhost. It always points to the device you are using, and traffic sent to it never leaves that device. It is not the local IP that other devices on your network use to reach you; that is an address such as 192.168.1.23 from your router. The whole block from 127.0.0.0 to 127.255.255.255 is reserved for loopback, and the IPv6 loopback address is ::1.

Is 192.168.1.1 my IP address?

Usually not. 192.168.1.1 is a common default address for home routers, so it is most likely your router’s local address, listed as Default Gateway, Router or Gateway in your network details. Your own device has a different address in the same range, such as 192.168.1.23. Neither one is your public IP, the address websites see.

What is 169.254.169.254 used for?

169.254.169.254 is the address of the instance metadata service on cloud platforms such as AWS and Microsoft Azure. A virtual machine queries it for information about itself, such as its network configuration, and on AWS also for temporary security credentials. It is a link-local address that answers only inside the cloud virtual machine, so it has no use on a home network.

What is a link-local IP address?

A link-local address works only on the network segment a device is directly connected to, and routers never forward it. In IPv4, these are 169.254.x.x addresses that a device gives itself when no DHCP server answers, which usually means it has no internet access. In IPv6, every network interface has a link-local address starting with fe80, and that is normal.