Yes, you can find your IP address in Windows using just the Command Prompt—no third-party tools required. Open Command Prompt and type ipconfig, then press Enter. Your IPv4 address will appear next to "IPv4 Address" under your active network adapter (usually Ethernet or Wi-Fi). For a quicker check, use ping google.com | find "Reply" to see your public IP. For the full guide, including how to distinguish between local and public IPs, follow the steps below.
What You'll Need
- A Windows PC (Windows 10 or 11).
- Administrator privileges (not always required, but some commands may prompt for them).
- An active internet connection (for checking public IP) or a local network (for local IP).
- Basic familiarity with the Command Prompt (though no prior experience is needed).
Step-by-Step
-
Open Command Prompt:
- Press the Windows key + R to open the Run dialog.
- Type
cmdand press Enter. Alternatively, search for "Command Prompt" in the Start menu and open it.
Note: Menu labels may vary slightly depending on your Windows version or region.
-
Find your local IPv4 address:
- In the Command Prompt window, type
ipconfigand press Enter. - Look for the section labeled with your active network adapter (e.g., "Wi-Fi" or "Ethernet").
- Under that section, locate the line that says
IPv4 Address. The value next to it (e.g.,192.168.1.100) is your local IP address. - (Optional) To see detailed information about your default gateway (router), DNS servers, and MAC address, look for the
Default GatewayandDNS Serverslines.
Example output:
Wi-Fi adapter Wi-Fi: Connection-specific DNS Suffix . : IPv4 Address. . . . . . . . . . . : 192.168.1.100 Subnet Mask . . . . . . . . . . . : 255.255.255.0 Default Gateway . . . . . . . . . : 192.168.1.1 - In the Command Prompt window, type
-
Find your public IP address (external IP):
- Type the following command in Command Prompt and press Enter:
ping google.com | find "Reply"This command sends a ping to Google's servers and extracts the IP address from the reply.
- The output will look like this:
Reply from 142.250.190.46: bytes=32 time=12ms TTL=118The IP address after "Reply from" (e.g.,142.250.190.46) is your public IP. - (Alternative) For a simpler method, type
nslookup myip.opendns.com resolver1.opendns.comand press Enter. The output will show your public IP under the "Address:" line.
- Type the following command in Command Prompt and press Enter:
-
Distinguish between local and public IP:
- A local IP address (e.g.,
192.168.x.x) is assigned by your router and is only visible on your home/office network. - A public IP address (e.g.,
142.250.x.x) is your unique address on the internet, assigned by your ISP. - Your local IP changes only if you disconnect/reconnect from the network or if your router reassigns it. Your public IP may change if your ISP dynamically assigns it (common with most home connections).
- A local IP address (e.g.,
Common Mistakes
-
Assuming the first IPv4 address is the correct one:
Your Command Prompt output may list multiple IPv4 addresses (e.g., for VPNs, virtual adapters, or secondary connections). Always check the adapter name (e.g., "Wi-Fi" or "Ethernet") to ensure you're looking at the right one.
-
Ignoring the adapter type:
If you're on a VPN or have multiple network connections, the
ipconfigoutput will show all of them. Focus on the adapter you're actively using (e.g., Wi-Fi for laptops, Ethernet for desktops). -
Misinterpreting the public IP command:
The
ping google.com | find "Reply"command relies on Google's servers being reachable. If you're offline or your ISP blocks pings, this won't work. In that case, usenslookup myip.opendns.com resolver1.opendns.comas an alternative. -
Not checking for typos:
Commands like
ipconfigare case-sensitive. TypingIpconfig(with a capital "I") will trigger an error. Always double-check your spelling.
Tips
-
Save time with aliases:
If you frequently check your IP, create a shortcut in Command Prompt by typing
alias ipcheck="ipconfig && ping google.com | find "Reply" && nslookup myip.opendns.com resolver1.opendns.com"(Note: Aliases in Windows Command Prompt are not permanent by default; you'd need a batch script for this). -
Use PowerShell for a cleaner output:
If you prefer PowerShell, run
Get-NetIPAddress | Where-Object InterfaceAlias -eq "Wi-Fi" | Select-Object IPAddressto filter for your Wi-Fi adapter specifically. -
Check for multiple adapters:
If you have a VPN or virtual machine running, your
ipconfigoutput may include additional adapters. Ignore these unless you're troubleshooting them. -
Note your subnet mask:
The
Subnet Maskvalue (e.g.,255.255.255.0) is important for network configuration. It defines the range of your local network. -
Clear the command history:
After checking your IP, you can clear the Command Prompt history by typing
cls(clear screen) orexitto close the window.
Troubleshooting
If your IP address isn't displaying correctly or the commands aren't working, try these steps:
-
Restart your network adapter:
- Press Windows + S, type
Device Manager, and open it. - Expand the
Network adapterssection. - Right-click your active adapter (e.g., Wi-Fi or Ethernet) and select
Disable device. Wait 10 seconds, then right-click again and chooseEnable device. - Re-run
ipconfigin Command Prompt to see if the IP address updates.
- Press Windows + S, type
-
Release and renew your IP:
- In Command Prompt, type
netsh interface ip resetand press Enter. This resets the TCP/IP stack. - Then type
netsh winsock resetand press Enter. - Restart your PC and check your IP again.
- In Command Prompt, type
-
Check for VPN or proxy interference:
- If you're using a VPN or proxy, your local IP may appear different from your public IP. Disable the VPN/proxy temporarily and re-check.
-
Verify internet connectivity:
- If you can't ping any external sites (e.g., Google), your public IP won't appear. Test connectivity with
ping 8.8.8.8. If this fails, your internet connection may be down.
- If you can't ping any external sites (e.g., Google), your public IP won't appear. Test connectivity with
-
Update your network drivers:
- Outdated or corrupted network drivers can cause
ipconfigto fail. Update them viaDevice Manager(right-click your adapter >Update driver).
- Outdated or corrupted network drivers can cause
-
Run Command Prompt as Administrator:
- Right-click Command Prompt and select
Run as administratorif you encounter permission errors.
- Right-click Command Prompt and select
If That Did Not Work
If none of the above steps resolve the issue, your system may have deeper network configuration problems. In that case:
- Check your router's admin panel (usually
192.168.1.1or192.168.0.1) to manually assign a static IP or verify network settings. - Contact your ISP to confirm your public IP assignment method (static vs. dynamic).
- As a last resort, reset your router to factory settings (this will disconnect all devices and require reconfiguration).
Frequently Asked Questions
What's the difference between a local IP and a public IP?
A local IP (e.g., 192.168.1.100) is assigned by your router and is only used within your home/office network. A public IP (e.g., 142.250.190.46) is your address on the internet, assigned by your ISP. Your router uses NAT (Network Address Translation) to share your public IP among all devices on your local network.
Why does my public IP change?
Most home internet connections use dynamic public IP addressing, meaning your ISP assigns a new public IP periodically (often daily or weekly). This is normal and not a sign of a problem. If you need a static public IP (e.g., for hosting a server), you'll need to contact your ISP to configure it.
How do I check my IP without Command Prompt?
You can check your local IP by:
- Clicking the Wi-Fi/Ethernet icon in the taskbar, then selecting the
Wi-Fi settings(Windows 10/11). Your local IP will appear under the network name. - Using online tools like
whatismyip.comto check your public IP in a web browser. - Checking your router's admin panel (e.g.,
192.168.1.1) for connected devices and their local IPs.
What if my local IP isn't showing in ipconfig?
If ipconfig doesn't display an IPv4 address, it could mean:
- Your adapter isn't connected to a network.
- Your DHCP client isn't receiving an address (check your router settings).
- There's a network driver issue (update or reinstall the driver).
Run ipconfig /release and ipconfig /renew to force a DHCP lease refresh. If the problem persists, your router may be misconfigured.
Is there a way to find my IP without internet access?
No, you can only find your public IP when connected to the internet. However, you can still find your local IP even without internet access using:
ipconfigin Command Prompt (as shown above).- Checking your router's admin panel (if you're connected to it).
- Using the Settings app (Windows 10/11): Go to
Settings > Network & Internet > Wi-Fi/Ethernetto see your local IP.
Why does my IP address have numbers like 169.254.x.x?
An IP address in the range 169.254.x.x indicates your device is using APIPA (Automatic Private IP Addressing), which happens when:
- Your device fails to obtain an IP from the DHCP server (router).
- Your network cable is unplugged (for wired connections).
- Your Wi-Fi is connected but not to a router (e.g., direct peer-to-peer connection).
To fix this, ensure your device is properly connected to a router and that the router's DHCP server is enabled. Run ipconfig /release and ipconfig /renew in Command Prompt to force a new DHCP lease.