Finding your IP address depends on your operating system
Your computer's IP address is a string of numbers separated by periods — something like 192.168.1.5 or 10.0.0.42. The exact steps to find it change depending on whether you use Windows, Mac, or Linux, but the process takes less than a minute on any of them. You will either open a command tool and type a single command, or navigate through your network settings.
There are two types of IP addresses you might see: a private IP address (the one your home or office network assigns to your computer) and a public IP address (the one your internet provider assigns to your whole network). Most of the time when someone asks for your IP address, they mean the private one. This guide covers both.
Key Takeaways
- Windows users can find their private IP address by opening Command Prompt and typing ipconfig, then looking for the line labeled "IPv4 Address".
- Mac users open Terminal and type ifconfig, then search the output for "inet" followed by a number — that is the private IP address.
- Linux users open a terminal and type ip addr or ifconfig depending on their distribution, then locate the address next to "inet".
- To find your public IP address on any system, visit a website like whatismyipaddress.com or type "what is my ip" into a search engine.
Finding your IP address in Windows
Open the Start menu and type cmd into the search box. Click on "Command Prompt" when it appears. A black window will open with a blinking cursor.
Type ipconfig and press Enter. A list of information will appear. Look for the section labeled with your network connection name (usually "Ethernet" if you are plugged in with a cable, or "Wireless LAN adapter" if you are using Wi-Fi). Under that section, find the line that says "IPv4 Address" — the number next to it is your private IP address. It will look something like 192.168.1.105.
If you see multiple network adapters listed, look for the one that is actually connected. You can tell because it will have an IPv4 Address listed; disconnected adapters will show blank lines or say "Media disconnected".
Finding your IP address on a Mac
Open Spotlight by pressing Command + Spacebar. Type terminal and press Enter. A white window with black text will open.
Type ifconfig and press Enter. A long list of network information will appear. Look for a section that starts with "en0" or "en1" (these are your network interfaces). Under that section, find the line that begins with "inet" followed by a space and a number — that number is your private IP address.
If you are connected by Wi-Fi, look for the section starting with "en0". If you are plugged in with an Ethernet cable, it might be "en5" or another number. The easiest way to find the right one is to look for the section that has an "inet" address; disconnected interfaces will not have one.
Finding your IP address in Linux
Open a terminal window. The method depends on your desktop environment, but usually you can right-click on the desktop and select "Open Terminal Here", or press Ctrl + Alt + T.
Type ip addr and press Enter. Look through the output for lines that start with "inet" followed by a number and a slash. That number is your private IP address. It will appear under a section labeled with your network interface name, usually something like "eth0" for Ethernet or "wlan0" for Wi-Fi.
If ip addr does not work on your system, try ifconfig instead. The output format is slightly different, but you are still looking for "inet" followed by your IP address. Some older Linux distributions use ifconfig by default.
Finding your public IP address
Your public IP address is assigned by your internet service provider and is what websites see when you connect to them. It is different from your private IP address, which only devices on your home or office network can see.
The simplest way to find your public IP address is to open any web browser and visit whatismyipaddress.com or ipchicken.com. Your public IP address will display on the page immediately. You can also type "what is my ip" into Google or any other search engine, and your public IP address will appear at the top of the results.
If you want to find your public IP address from the command line instead, you can type curl ifconfig.me in Windows PowerShell, Mac Terminal, or Linux Terminal. Your public IP address will print on the next line.
Understanding what you are looking at
IP addresses come in two formats: IPv4 and IPv6. IPv4 addresses look like 192.168.1.5 — four numbers separated by periods, each number between 0 and 255. IPv6 addresses look like 2001:0db8:85a3:0000:0000:8a2e:0370:7334 — they use letters and numbers separated by colons and are much longer. Most home networks still use IPv4, so that is what you will see in most cases.
When you run ipconfig, ifconfig, or ip addr, you may see multiple IP addresses listed. This happens if your computer has multiple network connections active at the same time — for example, both Wi-Fi and Ethernet plugged in. Only one will be actively carrying your traffic at any moment. If you are unsure which one is active, disconnect the one you are not using and run the command again.
The numbers after the slash in Linux output (like /24 in 192.168.1.5/24) represent the subnet mask. You do not need this for most purposes, but it tells your computer which other devices on the network it can reach directly.
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 connection problems with technical support, to configure port forwarding on your router, or to connect to your computer remotely. Some games and applications also ask for it when you are setting up a local network connection.
Will my IP address change?
Your private IP address usually stays the same unless you restart your router or your computer is offline for a long time. Your public IP address can change whenever your internet service provider assigns a new one, which might happen when you restart your modem or after several days of inactivity. If you need a permanent IP address, you can contact your internet provider about a static IP, though this usually costs extra.
Is it safe to share my IP address?
Sharing your private IP address is generally safe — it only works on your local network anyway. Sharing your public IP address is also usually safe, though it does tell someone your approximate location and internet provider. Never share it with someone you do not trust, and be cautious if a stranger asks for it unprompted.
What if the command does not work?
Make sure you typed the command exactly as shown, with correct spelling and spacing. On Windows, ipconfig is the right command; on Mac and Linux, it is ifconfig or ip addr. If you are still stuck, try restarting your terminal window and typing the command again. If the command runs but shows no results, your network connection may be disconnected.
Can I change my IP address?
You can change your private IP address by restarting your router, or by manually assigning a new one through your network settings — though this is rarely necessary. Your public IP address is controlled by your internet provider and cannot be changed directly, but restarting your modem may cause your provider to assign a different one.