You probably want the number a website sees when you visit it — your public IP address. On a Windows PC, open Command Prompt and type curl ifconfig.me; on a Mac, run the same command in Terminal. That returns your public IPv4 address in one line. If you need the address your router assigned to the machine itself, the command is ipconfig on Windows or ifconfig on macOS. These are two different numbers, and mixing them up is the most common reason people think they've been given the wrong answer.

The Two Numbers People Confuse and Which One Websites Actually See

Every computer on a home network holds a private address from a reserved block, and those blocks are fixed by a standard rather than by any manufacturer. The Internet Engineering Task Force's RFC 1918 sets aside three ranges: 10.0.0.0 through 10.255.255.255, 172.16.0.0 through 172.31.255.255, and 192.168.0.0 through 192.168.255.255. If your machine shows an address starting with any of those, nothing on the public internet can route to it directly.

Your router performs network address translation, swapping that private address for the single public address your internet provider handed it. A household of five devices browsing at once usually shares one public IPv4 address, which is why a site you both visit logs the same number for two different people. The identity websites record belongs to the household connection, not to your specific laptop.

So the address your machine owns privately and the address the world sees publicly answer different questions. Private tells you where you sit inside the house; public tells you how the house appears from outside. Diagnostic tasks like port forwarding or printer setup need the private one, while "what do sites see" questions need the public one.

A third number exists: the IPv6 address, which looks like eight groups of hexadecimal digits separated by colons. Most modern connections carry both an IPv4 and an IPv6 address simultaneously, and a site that supports IPv6 will see the six-format address even when your IPv4 address hasn't changed.

Opening Command Prompt or Terminal and Running the One-Line Public Check

The fastest path to your public address is a single command that asks an external service to report the address it observed. On Windows 10 or Windows 11, press the Windows key, type cmd, and press Enter. On macOS, open Launchpad, type terminal, and open it. Both shells accept the same command below.

1: Type curl ifconfig.me and press Enter. The response is your public IPv4 address on its own line. 2: If curl reports "command not found" on Windows, try curl https://api.ipify.org — Windows 10 build 17063 and later ship curl by default, but older builds do not. 3: On macOS, curl -4 ifconfig.me forces the IPv4 result if you also have IPv6 and want the older format specifically. 4: Press the up arrow to repeat either command after reconnecting a VPN, since the answer changes.

The failure case worth knowing: a VPN or a proxy will change what that command returns, because the command reports the exit point of your traffic, not the address your provider assigned. Disconnect the VPN and run it again to see the difference — that's the clearest proof of which layer you're looking at. Corporate laptops often route through a company egress, so the result there is the office's public address regardless of where you're sitting.

Reading ipconfig Output on Windows Without Misreading the Adapter List

Typing ipconfig alone gives a summary for every network adapter, and a laptop with Wi-Fi, Ethernet, Bluetooth, and a virtual VPN adapter may print four or five blocks. Look for the block labeled with the connection you're actually using, usually "Wireless LAN adapter Wi-Fi" or "Ethernet adapter Ethernet." Inside that block, the line "IPv4 Address" is the private address your router assigned.

The line you might not expect is "Default Gateway," which is your router's own address on the local network. That number is what you paste into a browser to reach the router's admin page, typically something like 192.168.1.1 or 192.168.0.1, though it varies by manufacturer. The "Subnet Mask" line tells you how large the local network is, and on home routers it's almost always 255.255.255.0.

Two traps catch people here. First, an adapter labeled "Media Disconnected" or showing an address beginning with 169.254 is not working — that 169.254 range is what Windows self-assigns when no DHCP server answered, and it means the machine never got a real address. Second, a virtual adapter from VPN software or a hypervisor can show a private address of its own, and reading that block by mistake sends you chasing a number nothing else on your network recognizes.

For the value on a single line, ipconfig piped through a filter is cleaner than scanning blocks. In PowerShell, Get-NetIPAddress -AddressFamily IPv4 lists every IPv4 address with its interface name in a table, which avoids the scrolling problem entirely.

The Equivalent Commands on macOS and Linux and Where They Differ

On a Mac, ifconfig prints every interface, and the one you want is usually en0 for Wi-Fi or en1 for a second adapter. The "inet" line inside that block carries the private IPv4 address. macOS also offers ipconfig getifaddr en0, which returns just the address with no surrounding text — far easier to copy than scanning the full dump.

Apple silicon Macs and Intel Macs use the same interface names, so en0 works on both. If you're on Ethernet rather than Wi-Fi, check en1 or run ifconfig unfiltered and look for the interface with a populated inet line. A Mac connected to a personal hotspot will show the phone's assigned range rather than your home router's.

Linux varies more by distribution. Modern systems ship the ip command, and ip addr show or the shorter ip a lists interfaces named things like wlan0 or enp3s0. The private address follows the word "inet" on the relevant interface. On older systems, ifconfig still exists and behaves like the macOS version.

The public check is identical across all three platforms: curl ifconfig.me works in macOS Terminal and any Linux shell without modification. That portability is why the curl approach beats hunting through graphical settings menus on any operating system.

Finding the Same Address Through Settings Apps and Browser Pages

If you'd rather not touch a terminal, Windows 11 puts the private address under Settings, then Network & internet, then the properties of your active connection. Windows 10 hides it under Settings, Network & Internet, Status, then View your network properties. Both routes show the IPv4 address alongside the gateway and DNS servers.

macOS places it under System Settings, Network, then the active connection, where the address appears next to "IP Address." Older macOS versions kept it under System Preferences, Network, and the same panel. The value matches what ipconfig getifaddr en0 returns.

For the public address, a browser search for "what is my ip" returns the number at the top of the results in Google and Bing, which is the option most people actually use. The catch is that any such page reports what the server saw, so a VPN, proxy, or corporate network changes the answer. That's not a bug in the page — it's the correct answer for the path your traffic took.

Router admin pages show a third angle. Logging into the gateway address from ipconfig and finding the WAN or Internet status section displays the public address your provider assigned to the router. It should match the curl result when no VPN is active, and comparing the two is a quick way to confirm nothing is intercepting your traffic.

A Side-by-Side Table of Every Method in This Article

Method Platform Shows Time to run Typical result
curl ifconfig.me Windows, Mac, Linux Public IPv4 Under 5 seconds One address, no labels
ipconfig Windows Private IPv4, gateway, mask Under 10 seconds Multiple adapter blocks
ipconfig getifaddr en0 macOS Private IPv4 only Under 5 seconds Single bare address
ip a Linux Private IPv4 and IPv6 Under 10 seconds Interface-by-interface list
Settings app Windows 11, macOS Private IPv4, gateway, DNS About 20 seconds Readable panel
Router admin page Any browser Public address at the router 1-3 minutes Requires router login
Search results page Any browser Public IPv4 Under 5 seconds Reflects VPN or proxy exit

The verdict splits by need. If you're configuring a device, use the settings panel or ipconfig because you need the private number the router knows. If you're checking how a website identifies you, use the curl command or a search result, since both report the observed public address. Skip the router page unless you're already logged in for another reason — the extra minute rarely pays off.

When Your IP Changes and How Long a Provider Usually Keeps It

Residential internet providers typically assign addresses dynamically, which means yours can change after a modem reboot, a long disconnection, or a lease expiry. The lease duration is set by the provider and commonly runs anywhere from a few hours to several days, though exact values vary by company and plan and aren't published as a fixed rule. Static addresses are usually a business-plan feature or an add-on.

Your public address can change for reasons you didn't cause. Providers reshuffle address pools during maintenance, and reconnecting after an outage often produces a new number. That's why a port-forwarding rule or a home-server bookmark tied to the old address stops working, and why dynamic DNS services exist to keep a hostname pointed at the current value.

The private address changes far more often. A router hands out addresses by DHCP with its own lease timer, often measured in hours rather than days, and a device that reconnects after a long absence may receive a different number. Within a single session, though, the private address stays stable, so anything you set up today will keep working until the device disconnects or the lease expires.

If you need an address that never moves, the request goes to your provider, not to your router settings. Static public addresses usually carry a monthly fee on residential accounts, and the amount depends on the provider and region — confirm current pricing directly with the company rather than relying on any figure quoted elsewhere.

VPNs, Proxies, and Mobile Hotspots That Rewrite the Answer

A VPN doesn't change your machine's private address. It adds a virtual adapter that reroutes outbound traffic to a server elsewhere, and that server's address becomes what websites see. Run ipconfig with a VPN connected and you'll usually find an extra adapter block alongside your normal Wi-Fi one — the private address on the Wi-Fi block is still your router's assignment.

Split-tunneling configurations complicate this further. Some VPN clients send only selected apps through the tunnel, so a browser might report the VPN's address while a terminal command reports your home connection's address on the same machine. If two checks disagree, that's the usual reason, and it's worth confirming in the VPN client's settings before assuming one result is wrong.

Mobile hotspots and tethering produce a different wrinkle. A phone on a cellular plan often assigns the tethered laptop a carrier-grade private address, and the carrier translates it again before traffic reaches the internet. The public address in that case may be shared among many subscribers, which is why some services behave differently on cellular than on home broadband.

Proxies operate at the application level. A browser extension or a configured system proxy sends requests through an intermediary, and the destination sees the proxy's address. The curl command will reflect that too if the proxy is set system-wide, but a proxy configured only inside one browser leaves terminal checks reporting your true address.

What Each Type of Address Does and Doesn't Reveal to a Website

A website that logs your public address learns the network you're on, not your identity. It can look up the registered owner of that address block, which for home connections is usually your internet provider rather than your name, and it can estimate a general geographic area through commercial databases that map address ranges to regions. Those maps are approximate and frequently wrong at city level, especially with mobile carriers.

Your private address never leaves your network. It appears nowhere in the traffic a website receives, because the router replaces it during translation. That's why quoting your 192.168 address to a support agent asking for "your IP" produces a puzzled response — they need the public one.

IPv6 changes the picture somewhat. Under IPv6 there is no translation step in many home setups, so your device's own address is what websites see, and that address can embed a portion of your provider's network identifier. Privacy extensions, which rotate the interface portion of the address periodically, exist to reduce long-term tracking, and most modern operating systems enable them by default.

None of this tells a site who you are on its own. Account logins, cookies, browser fingerprinting, and payment details link activity to a person, and the address is one signal among many. Treating an IP address as an identity is a misreading of what the number represents.

FAQ

Does my private IP address start with 192.168 or can it be different?

It can be different, and often is. The RFC 1918 private ranges include 10.0.0.0 through 10.255.255.255 and 172.16.0.0 through 172.31.255.255 as well as the 192.168 block, so an address beginning with 10 or 172.16 is equally valid and equally invisible to the internet. Some routers and mesh systems default to the 10 range specifically to avoid collisions with other equipment.

Why does my IP address change every time I restart my router?

Because your provider assigns addresses dynamically and often hands out a new one when the connection re-establishes. Lease timers and pool reshuffling both play a part, and the exact behavior depends on the company and plan. If you need a fixed public address, that's a request for your provider's static-IP option, which typically carries a recurring charge.

Can two computers on the same Wi-Fi have the same IP address?

They cannot share a private address at the same time — the router's DHCP server prevents that, and a duplicate causes an address conflict error. Two devices on one home network will, however, share the same public address, because the router translates both through one provider-assigned number. That shared public value is what websites log for the whole household.

Does a VPN hide my IP address from websites completely?

It replaces the address websites see with the VPN server's address, which is the main function. It does not hide the fact that you're using a VPN in every case, and browser fingerprinting can still link sessions across address changes. Split-tunneling setups can also leak your real address through apps that bypass the tunnel.

What does an address beginning with 169.254 mean?

It means your computer failed to get an address from the router. Windows self-assigns from the 169.254 range when no DHCP response arrives, and a machine showing that address cannot reach the internet or other devices on the local network. Check the cable or Wi-Fi connection first, then restart the router.

Is it safe to share my public IP address in a forum post?

It's riskier than most people assume. The address reveals your provider and an approximate region, and it can be used to probe for open services on your connection. If you must share one for troubleshooting, mask the last group of digits, since support staff rarely need the full number to help.

How do I find my IP address on a phone connected to the same network?

On iPhone, open Settings, then Wi-Fi, and tap the info button beside the connected network to see the address. On Android, the Wi-Fi network's details panel shows it under Network details. Both report the private address the router assigned, matching what ipconfig would show for a laptop on the same network.