How to find your IP address in Command Prompt

Open Command Prompt on your computer and type ipconfig, then press Enter. The tool will display your IP address along with other network details. On Windows, this is the fastest way to see what IP address your device is currently using.

Your IP address appears next to "IPv4 Address" in the output. It looks like four numbers separated by periods — for example, 192.168.1.5. This is the address your device uses to communicate on your local network. If you need your public IP address instead (the one your internet provider assigns), you will need a different command, covered below.

Key Takeaways

  • Type ipconfig in Command Prompt to see your local IP address next to "IPv4 Address".
  • Type ipconfig /all to see additional details like your MAC address and DNS servers.
  • Your local IP address (like 192.168.1.5) is different from your public IP address, which your internet provider assigns.
  • Command Prompt is built into Windows and requires no installation or download.

Opening Command Prompt on Windows

Press the Windows key and type "cmd" into the search box. Click "Command Prompt" when it appears in the results. The window will open with a black background and a blinking cursor ready for input.

Alternatively, press Windows key + R to open the Run dialog, type "cmd", and press Enter. Both methods open the same tool. Once it is open, you can type commands directly at the prompt.

Understanding the ipconfig output

When you type ipconfig and press Enter, Command Prompt shows information about each network connection on your computer. Look for the section labeled "Ethernet adapter" or "Wireless LAN adapter" depending on how you are connected to the network.

The "IPv4 Address" line shows your local IP address — the one your router assigned to your device. Below that, you will see "Subnet Mask" (usually 255.255.255.0) and "Default Gateway" (usually your router's address, like 192.168.1.1). These work together to let your device talk to other computers on the same network.

If you have multiple network adapters, ipconfig will list each one separately. You only need the address from the adapter you are actually using — the one marked as connected.

Getting more detail with ipconfig /all

Type ipconfig /all to see expanded information about your network setup. This command shows your MAC address (a unique identifier for your network card), your DNS servers, and whether your IP address was assigned automatically or manually.

The MAC address appears as "Physical Address" and looks like six pairs of letters and numbers separated by hyphens — for example, 00-1A-2B-3C-4D-5E. You may need this if you are troubleshooting network problems or setting up a device on your network. The DNS servers listed are the ones your computer uses to translate website names into IP addresses.

Finding your public IP address

Your local IP address (from ipconfig) is only visible to devices on your home or office network. Your public IP address is what websites and internet services see when you connect to them. Command Prompt does not have a built-in command to show your public IP, but you can find it through other means.

Visit a website like whatismyipaddress.com or ipinfo.io in your web browser to see your public IP instantly. These sites detect the address your internet provider assigned to your connection. If you need to check it from Command Prompt itself, you can use curl ifconfig.me (on Windows 10 and newer), which downloads and displays your public IP address.

Saving your IP information to a file

If you need to keep a record of your network settings, you can save the output to a text file. Type ipconfig /all > network_info.txt and press Enter. Command Prompt will create a file called "network_info.txt" in your user folder containing all the network information.

You can then open this file in Notepad or any text editor to review the details later. This is useful if you are troubleshooting a network problem and need to compare settings over time, or if you need to share your network information with technical support.

Troubleshooting when ipconfig does not work

If you type ipconfig and see an error message like "command not found", your system may have a problem with Command Prompt itself. Try closing and reopening Command Prompt, or restart your computer and try again.

If Command Prompt opens but shows no network adapters, your computer may not be connected to a network. Check that your ethernet cable is plugged in or that you are connected to a wireless network. If you are connected but still see no adapters, your network drivers may need updating — check your device manufacturer's website for driver downloads.

Frequently Asked Questions

What is the difference between IPv4 and IPv6?

IPv4 addresses use four numbers separated by periods (like 192.168.1.5), while IPv6 addresses use letters and numbers separated by colons (like 2001:0db8:85a3:0000:0000:8a2e:0370:7334). IPv6 is the newer standard with many more possible addresses. Most home networks still use IPv4, but newer devices may show both.

Can I change my IP address from Command Prompt?

You can change your local IP address using the netsh command in Command Prompt, but most home users should not do this — your router assigns addresses automatically and changing them can break your network connection. If you need a static IP for a specific device, it is safer to configure that in your router's settings instead.

Is my IP address the same as my MAC address?

No. Your IP address is like your mailing address (it changes and is assigned by your network), while your MAC address is like your device's serial number (it stays the same and identifies your network card specifically). Both appear in the ipconfig /all output but serve different purposes.

Why do I see 127.0.0.1 in the output?

That is your computer's loopback address, a special address your device uses to talk to itself. It is not your actual network IP address. Look for the IPv4 address under your Ethernet or Wireless adapter section instead.