You can find your IP address on a computer through the operating system's network settings or a command-line tool. On Windows, open Settings > Network & Internet > Properties, or run ipconfig in Command Prompt. On macOS, open System Settings > Network or run ifconfig. On Linux, run ip addr or hostname -I. These commands show your local address; your public address requires a query to an outside service.

What an IP address actually is

An IP address is a numeric label assigned to a network interface so packets can be routed to and from it. IPv4 addresses are 32 bits long, written as four decimal octets from 0 to 255, giving roughly 4.3 billion possible values. IPv6 addresses are 128 bits, written as eight hexadecimal groups, which expands the space to about 340 undecillion addresses.

Every computer typically holds more than one address at once. A loopback address (127.0.0.1 in IPv4, ::1 in IPv6) refers to the machine itself and never leaves it. A link-local address (169.254.x.x in IPv4, fe80:: in IPv6) works only on the local segment. A private address is used inside your home or office network. A public address is what the internet sees.

The distinction matters because "my IP address" means different things depending on who is asking. A website sees your public address. Your router sees your private address. Your own machine sees all of them.

How local and public addresses diverge

Your router performs network address translation, usually called NAT. It rewrites the source address on outgoing packets, replacing your private address with the router's public one. When a reply comes back, the router consults a translation table and forwards the packet to the correct internal machine.

This is why your computer's local address and your public address rarely match. A typical home router assigns private addresses from ranges reserved by RFC 1918: 10.0.0.0 to 10.255.255.255, 172.16.0.0 to 172.31.255.255, and 192.168.0.0 to 192.168.255.255. These ranges are never routed on the public internet, which is why millions of households can reuse 192.168.1.5 without conflict.

The translation table is the mechanism. Each active connection gets an entry mapping an internal address and port to an external port. A single public address can therefore support hundreds of simultaneous connections from dozens of devices. The router distinguishes them by port number, not by address.

A counterintuitive detail: your public IP address is usually the router's address, not your computer's. If you run a command on your machine and see 192.168.1.42, that number identifies your computer only within your own network. No website can see it.

Finding your address on each platform

Windows offers the widest set of routes. The graphical path is Settings > Network & Internet > Wi-Fi or Ethernet > your connection > Properties, where the IPv4 address appears under "IPv4 address." The command path is faster for scripting: open Command Prompt and type ipconfig, which lists every adapter with its IPv4 address, subnet mask, and default gateway. Add /all for MAC addresses, DHCP lease details, and DNS servers.

macOS splits the information across two tools. System Settings > Network shows the active connection's IP address directly. The terminal command ifconfig lists every interface with its inet (IPv4) and inet6 (IPv6) addresses. The command ipconfig getifaddr en0 returns just the Wi-Fi address, which is useful in scripts.

Linux varies by distribution but the modern standard is ip addr, which replaced the older ifconfig in most distributions. The command hostname -I prints all assigned addresses on one line. Desktop environments like GNOME and KDE also expose the address in their network settings panels.

For your public address, none of these tools help. You need an external query. Searching "what is my IP" in a browser, or visiting a service like ifconfig.me, returns the address the internet sees. The query works because the remote server reads the source address of your incoming connection.

Platform Graphical path Command Public address method
Windows 10/11 Settings > Network & Internet > Properties ipconfig Browser search or curl ifconfig.me
macOS System Settings > Network ifconfig or ipconfig getifaddr en0 Browser search or curl ifconfig.me
Linux (desktop) Network settings panel ip addr or hostname -I Browser search or curl ifconfig.me
ChromeOS Settings > Network > Wi-Fi Not available Browser search
iOS/iPadOS Settings > Wi-Fi > (i) Not available Browser search

The address lifecycle and when it changes

IP addresses are not permanent. Your router leases its public address from your internet provider using DHCP, typically for a period measured in hours to days. When the lease expires, the provider may renew the same address or assign a different one. Many residential providers keep the same address for months, but nothing guarantees it.

Your computer's private address follows a similar lease cycle inside your home network. Routers usually assign addresses from a pool and hold the assignment for a set lease time, often 24 hours by default on consumer equipment. A device that disconnects for longer than the lease may return to a different address.

Time point Typical event Effect on your address
Device connects DHCP request sent to router Private address assigned from pool
Lease halfway point Client requests renewal Same address usually retained
Lease expiry without renewal Address returned to pool Next connection may differ
Router reboot Lease table may reset Devices may receive new private addresses
Provider lease renewal ISP reassigns or renews public address Public address may change
Modem replacement New hardware identity Public address often changes
Moving to a new network Entirely new DHCP scope All addresses change

The practical consequence is that any service relying on a stable address, such as a home server or remote desktop, needs a dynamic DNS service or a static address arrangement with the provider.

Edge cases that break the simple answer

Virtual private networks reroute traffic through a remote server. When a VPN is active, your public address becomes the VPN server's address, not your home connection's. Your local address may also change to one assigned by the VPN's virtual adapter. Disconnecting the VPN restores the original routing.

Virtual machines and containers add another layer. A VM running on your computer typically has its own virtual network adapter with its own private address, often in a different subnet from the host. The host and guest see different addresses, and neither may match what the router assigned.

Mobile hotspots and tethering create a nested NAT. Your laptop connects to your phone, which connects to the cellular network, which may itself sit behind carrier-grade NAT. In that arrangement, your public address is shared with many other subscribers, and inbound connections are usually impossible.

Red flags to watch for:

A public address beginning with 100.64 through 100.127 indicates carrier-grade NAT, meaning you do not control a unique public address. An address beginning with 169.254 indicates the device failed to obtain a DHCP lease and self-assigned a link-local address. An address of 0.0.0.0 means no address is assigned to the interface. A public address that changes every few minutes may indicate a rotating proxy or a provider with very short leases. An address outside your expected subnet after connecting to a VPN suggests split tunneling is misconfigured.

Common misconceptions about IP addresses

The most persistent misconception is that an IP address identifies a person. It identifies a network interface at a point in time. Multiple people share one address behind NAT, and one person uses many addresses across devices and networks. Law enforcement requests to providers can link an address to an account, but the address alone does not name anyone.

A second misconception is that your IP address reveals your precise location. Geolocation databases map addresses to a region, city, or sometimes a postal code, usually accurate only to the city level and sometimes wrong by hundreds of miles. The databases infer location from registration records and observed routing, not from a physical fix.

A third is that hiding your IP address makes you anonymous. A VPN changes the address seen by destinations, but browser fingerprinting, cookies, logged-in accounts, and timing analysis can still identify you. The address is one signal among many.

A professional caveat worth knowing: two devices on the same network can appear to share a public address to an outside server, but that server can still distinguish them by source port. Port numbers are part of the connection identity, which is why NAT works at all. The address alone does not uniquely identify a connection.

Practical actions for diagnosing address problems

Start with the local address before assuming a public-facing problem. If your computer shows a 169.254 address, the DHCP request failed. Check the cable, the Wi-Fi association, and whether the router is powered on. Renew the lease with ipconfig /release followed by ipconfig /renew on Windows.

If the local address is correct but internet access fails, test the default gateway. The gateway address appears in the same ipconfig output and is usually the router's private address. Pinging it confirms whether the local link works. A successful ping to the gateway with a failed ping to an external address points to a routing or DNS problem, not an address problem.

If a website reports a different public address than expected, check for a VPN or proxy. Disable the VPN and reload the page. If the address changes back, the VPN was the cause. If the address stays the same, a proxy or a browser extension may be intercepting traffic.

For services that need a stable public address, compare three options. A static address from your provider is the most reliable but not always offered. Dynamic DNS maps a changing address to a fixed hostname and costs nothing to modest amounts, depending on the provider. A VPN with a dedicated address provides stability but routes your traffic through a third party. Decide based on whether inbound connections or simple stability matter more.

Thresholds matter here. Many providers renew leases without changing the address, so a home server may run for months on one address. But a single router reboot or provider maintenance can break that assumption. If uptime matters, treat the address as volatile and design around it.

Limitations of what the address tells you

An IP address is an addressing label, not a trust signal. Two connections from the same address are not necessarily the same user, and one user may appear from many addresses. Any security decision based solely on the address, such as blocking or allowing by IP, is brittle.

The tools described here report the addresses assigned to interfaces and the address seen by a remote server. They do not report the address your provider uses internally, the routes between networks, or the address of any intermediary. For those, you need traceroute and provider-side logs.

Finally, the process differs on managed devices. Corporate laptops often route traffic through a proxy or a always-on VPN, so the address you find locally may not be the one the internet sees. Check with your organization's IT guidance if the device is managed.