How to Find Your IP Address on Any Device
You can find your public IP using online tools and your private IP through device settings or command line tools like ipconfig.
How to Find Your IP Address
Your IP address is your device's identifier on the internet and on your local network. Knowing how to find both your public and private IP addresses is a fundamental networking skill, useful for troubleshooting connectivity issues, hosting servers, setting up remote access, and verifying that a VPN is working correctly.
Public IP vs Private IP
There are two distinct types of IP address associated with your device, and they serve different purposes. Understanding the difference is the first step to knowing which one you need to find.
Your public IP address is the address that the internet sees when your device makes a request. It is assigned by your Internet Service Provider and is shared by all devices on your home or office network. When you visit a website, the server sees your public IP, not the individual IP of your laptop or phone.
Your private IP address is your device's address within your local network, assigned by your router via DHCP. It is only visible to other devices on the same network and is not reachable directly from the internet. Private IP addresses fall within reserved ranges such as 192.168.x.x, 10.x.x.x, and 172.16.x.x to 172.31.x.x. Your router uses Network Address Translation (NAT) to map requests from your private IP to your public IP and back when communicating with the internet.
| Feature | Public IP | Private IP |
|---|---|---|
| Assigned By | Your Internet Service Provider | Your router via DHCP |
| Visible To | Any server or device on the internet | Only devices on your local network |
| Typical Range | Any address not in the reserved private ranges | 192.168.x.x, 10.x.x.x, 172.16.x.x to 172.31.x.x |
| Shared | Shared by all devices on your network | Unique to each device on your local network |
| Changes | May change when your ISP reassigns it, unless static | May change when the router reassigns it, unless reserved |
How to Find Your Public IP Address
Your public IP address is the one assigned to your router by your ISP. All traffic leaving your local network appears to originate from this address. There are several quick ways to find it.
- Search engine: Type "what is my IP" into Google, Bing, or DuckDuckGo. The result appears at the top of the page instantly.
- IP lookup websites: Sites like
ifconfig.me,ipinfo.io, orwhatismyip.comdisplay your public IP along with additional information such as your approximate location and ISP name. - Command line on macOS or Linux: Run
curl ifconfig.mein the terminal. The command fetches your public IP from the service and prints it directly. - Command line on Windows: Run
curl ifconfig.mein Command Prompt or PowerShell. On older Windows versions without curl, you can useInvoke-WebRequest -Uri "https://ifconfig.me/ip"in PowerShell. - Router admin page: Log into your router's administration interface, usually accessible at
192.168.1.1or192.168.0.1. The WAN or Internet section shows your current public IP address assigned by your ISP.
How to Find Your Private IP Address
Your private IP address is assigned by your router and identifies your specific device on the local network. The method for finding it varies by operating system and device type.
| Device | Method | Command or Steps |
|---|---|---|
| Windows | Command Prompt | Open Command Prompt and run ipconfig. Look for the IPv4 Address field under your active network adapter. |
| macOS | Terminal | Run ifconfig | grep inet and look for an address starting with 192.168 or 10. Alternatively, go to System Settings, Network, select your connection, and the IP is shown directly. |
| Linux | Terminal | Run ip addr show and look for the inet line under your active interface, or run hostname -I for a quick output. |
| Android | Settings | Go to Settings, Wi-Fi, tap the connected network name, and look for the IP address field in the network details. |
| iPhone or iPad | Settings | Go to Settings, Wi-Fi, tap the information icon next to your connected network, and the IP Address field is shown under the IPv4 Address section. |
Ethernet adapter Local Area Connection:
IPv4 Address. . . . . . : 192.168.1.5
Subnet Mask . . . . . . : 255.255.255.0
Default Gateway . . . . : 192.168.1.1
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP>
inet 192.168.1.8/24 brd 192.168.1.255 scope global eth0
Understanding the Result
The output from ipconfig or ifconfig contains several fields that work together to define your device's network configuration. Understanding what each one means helps you interpret the result correctly and diagnose problems.
| Field | What It Means |
|---|---|
| IPv4 Address | Your device's private IP address on the local network. This is the address other devices on the same network use to communicate with you. |
| Subnet Mask | Defines which part of the IP address identifies the network and which part identifies the individual device. A mask of 255.255.255.0 means the first three octets identify the network and the last octet identifies the device. |
| Default Gateway | The IP address of your router. All traffic destined for addresses outside your local network is sent to this address first, and the router forwards it onward. |
| IPv6 Address | Your device's IPv6 address if your network supports it. IPv6 addresses are much longer than IPv4 and use hexadecimal notation separated by colons. |
| DNS Servers | The addresses of the DNS resolvers your device uses to translate domain names into IP addresses. Often your router's IP on a home network, which then forwards queries to your ISP or a public resolver. |
Why Knowing Your IP Address Is Useful
Knowing how to find and interpret your IP addresses comes up regularly in practical networking and development scenarios.
- Port forwarding: To make a device or service on your local network reachable from the internet, you configure port forwarding on your router to direct incoming traffic to a specific private IP address. You need to know the private IP of the target device to set this up correctly.
- Remote desktop and remote access: Connecting to your computer from another location requires knowing either its public IP (for direct internet access) or its private IP (for access within the same network). A static or reserved IP makes this more reliable.
- Local development server sharing: When testing a web application on your local machine, you can share it with other devices on the same network by having them connect to your private IP address and the port your development server is running on.
- VPN verification: After connecting to a VPN, checking your public IP confirms that traffic is being routed through the VPN server. If your public IP has changed to the VPN server's address, the VPN is working. If it shows your original ISP address, there may be a leak.
- Network troubleshooting: Comparing your expected IP range with your actual IP address helps diagnose whether your device is on the correct network, has received a valid DHCP assignment, or is experiencing a configuration issue.
Frequently Asked Questions
- Does my IP address change?
Both your public and private IP addresses can change under normal circumstances. Your private IP is assigned by your router's DHCP server and may be reassigned to a different address when your lease expires or your device reconnects. Your public IP is assigned by your ISP and may change when your router reconnects or periodically depending on your ISP's policies. If you need a stable address for hosting or remote access, you can request a static public IP from your ISP or configure a DHCP reservation in your router to always assign the same private IP to a specific device based on its MAC address. - Can someone find my location from my IP address?
Your public IP address can be used to identify your approximate geographic location, typically to the level of city or region, using geolocation databases. It cannot pinpoint your exact street address. Your ISP holds the precise mapping between IP addresses and physical locations, and this information is only disclosed to law enforcement with appropriate legal authority. If you want to obscure your approximate location from websites and services, a VPN replaces your public IP with the VPN server's IP address. - How do I get a static IP address?
For a static public IP, contact your ISP. Most residential ISPs offer static IP addresses as an add-on service for an additional monthly fee. For a stable private IP, you do not need to contact your ISP. Instead, configure a DHCP reservation in your router's admin panel, associating your device's MAC address with a specific IP address. The router will always assign the same private IP to that device every time it connects. - Why does my device show multiple IP addresses?
A device may have multiple IP addresses for several reasons. It may be connected to more than one network simultaneously, such as both Wi-Fi and Ethernet. It may have both an IPv4 and an IPv6 address on the same interface. Virtual machines and development tools like Docker also create virtual network interfaces that each have their own IP addresses. When runningipconfigorip addr, look for the adapter corresponding to your active internet connection and focus on the IPv4 address shown there. - What is a loopback address and will it appear in my results?
The loopback address127.0.0.1is a special address that refers to the device itself. It is used by software to communicate with services running on the same machine without going through the network hardware. You will see it in the output of commands likeip addron Linux listed under thelointerface. It is not a real network address and cannot be used to communicate with other devices. You can safely ignore it when looking for your actual private IP address.
Conclusion
Finding your IP address takes less than a minute using built-in tools available on every operating system. Understanding the difference between your public IP, which the internet sees, and your private IP, which identifies your device on the local network, is a foundational networking skill that applies to troubleshooting, hosting, remote access, and development. Knowing how to read the full output of tools like ipconfig and ip addr gives you a clear picture of your network configuration at a glance. Explore public vs private IP addresses and IPv4 vs IPv6 to build a deeper understanding of how IP addressing works across the internet.
