Open Command Prompt and run the right command
Your IP address is a set of numbers that identifies your computer on a network. To see it, you open Command Prompt — a text-based tool built into Windows — and type a single command. The fastest way is to press the Windows key, type cmd, and press Enter. A black window opens with a blinking cursor.
Once Command Prompt is open, type ipconfig and press Enter. Windows displays a list of network information, including your IP address. Look for the line that says "IPv4 Address" — that number (usually four groups of digits separated by periods, like 192.168.1.5) is your local IP address on your home or office network.
Key Takeaways
- Press the Windows key, type cmd, and press Enter to open Command Prompt.
- Type ipconfig and press Enter to display your network settings, including your IP address.
- Your IPv4 Address is the number you use to identify your computer on your local network.
- If you need your public IP address (the one your internet provider assigns), use ipconfig /all to see more details, or search "what is my IP" in a web browser.
Understanding what ipconfig shows you
When you run ipconfig, Command Prompt lists every network connection your computer has. Most people see at least two: one for Ethernet (if you plug in a cable) and one for Wi-Fi. Each shows its own IP address.
The "IPv4 Address" is what most devices and programs use to find your computer. The "Default Gateway" (usually something like 192.168.1.1) is your router. The "Subnet Mask" tells your computer which other devices are on the same local network. You usually only need the IPv4 Address, but all three are there if you need them.
Getting more detail with ipconfig /all
If you type ipconfig /all instead of just ipconfig, Command Prompt shows extra information about each network connection. This includes your MAC address (a different kind of identifier for your hardware), your DHCP server, and when your IP address lease expires.
Most people do not need this extra information for everyday tasks. But if you are troubleshooting a network problem or setting up a device to always use the same IP address, ipconfig /all gives you what you need to see.
The difference between your local and public IP address
The IP address that ipconfig shows you is your local IP address — the one your computer uses inside your home or office network. It starts with 192.168, 10, or 172 and is only visible to devices on your own network.
Your public IP address is different. It is assigned by your internet provider and is what websites see when you visit them. To find your public IP address, open a web browser and search for "what is my IP" — Google and other search engines will display it at the top of the results. You cannot see your public IP address in Command Prompt without extra steps.
Copying your IP address from Command Prompt
If you need to copy the IP address to paste it somewhere else, you can highlight it in the Command Prompt window. Click and drag to select the numbers, then right-click and choose "Copy" from the menu. You can then paste it into an email, a document, or a web browser.
Alternatively, in newer versions of Windows, you can select the text and press Ctrl+C to copy it directly without using the right-click menu.
Other commands that show network information
ipconfig /release and ipconfig /renew are two commands that change your IP address rather than just display it. Release tells your router to forget your current IP address, and renew asks for a new one. This is useful if your internet connection is acting up, but you should only use these if you know what you are doing or if someone helping you with a technical problem asks you to.
ipconfig /flushdns clears your computer's memory of website addresses it has visited. This is not related to your IP address, but it is another command people run in Command Prompt when troubleshooting network issues.
Frequently Asked Questions
Why do I need to know my IP address?
You might need it to set up a printer or security camera on your network, to troubleshoot why a device cannot connect, or to give to someone helping you with a technical problem. Websites do not need your local IP address — they see your public one. Your local IP address is only useful inside your own network.
Will my IP address change?
Your local IP address usually stays the same for weeks or months, but it can change if you restart your router or if your internet provider changes your settings. Your public IP address changes less often, but it can shift if your provider reassigns it. Neither change is something you need to worry about for normal computer use.
Is it safe to share my IP address?
Sharing your local IP address (the 192.168 number) is safe — it only works inside your own network. Sharing your public IP address is generally safe too, since websites already see it. However, do not share either one with someone you do not trust, because someone with bad intentions could use it to try to access your computer.
What if ipconfig does not show an IP address?
If you see "Media disconnected" or no IP address listed, your network connection is not working. Check that your Wi-Fi is turned on or your Ethernet cable is plugged in. Restart your router by unplugging it for 30 seconds, then plugging it back in. Run ipconfig again after the router restarts.