What Is My IP Address?

This page shows the public IP address your connection uses right now, together with the ISP that owns it and an estimated location. If your connection has both an IPv4 and an IPv6 address, both are shown, because a dual-stack browser only ever reveals one of them to a given site. We do not save the result; our API's request logs keep your IP for a few days (see the privacy policy). Use it to fill in a firewall allowlist, confirm a VPN is working, or check whether you are on IPv6.

Your public IP address

Detecting your address...

Public versus private address

Every device on your home or office network has a private address such as 192.168.1.20, handed out by the router. Those addresses are not routable on the internet. When you open a website, the router replaces the private address with the single public one your ISP assigned, which is what this page shows and what every website, game server and API sees.

IPv4 and IPv6 at the same time

Most connections today have both. When a site is reachable over both protocols, the browser picks IPv6 and the site only sees that address. To show the other one as well, the page makes two small extra requests to hosts that exist only on IPv4 or only on IPv6, so each can reveal one family. A box that says not available means your network has no route for that protocol, which is normal for many home routers on IPv6 and for some mobile carriers on IPv4.

Why the location is approximate

There is no GPS involved. The city and country come from where the address block is registered and how it is routed. For a fixed line that is usually the right city. For mobile data the carrier often concentrates traffic in a regional hub, so the city can be wrong while the country is still right.

How to use the What Is My IP Address? tool

  1. Open the page. Your public IPv4 and IPv6 addresses are shown immediately, each found by a request that can only travel over that protocol.
  2. Below the addresses you see the estimated city and country, the ISP or organization and its AS number, and the Cloudflare data center that handled the request. The last rows show the TLS and HTTP versions your browser used.
  3. Click Copy to put the address on the clipboard, for example to add it to a firewall allowlist or a server's SSH rules.
  4. If you are on a VPN, the address and location belong to the VPN's exit server. Disconnect and refresh to see your real one.
  5. To look up who owns the address or which network block it belongs to, click Look up in WHOIS.

How to get your public IP address in code

curl

# Plain text, nothing else
curl -s https://webdevutility.com/api/ip | jq -r .ip

# Full JSON with location and ISP
curl -s https://webdevutility.com/api/ip

Local addresses come from the OS instead: ip addr on Linux, ipconfig on Windows, ifconfig on macOS.

JavaScript (browser or Node.js)

const res = await fetch("https://webdevutility.com/api/ip");
const { ip, version, location, network } = await res.json();
console.log(ip, version, location.city, location.country, network.organization);

A browser cannot read its own public IP from JavaScript. Some service on the other end has to echo the address it saw, which is what this endpoint does.

Python

import requests

data = requests.get("https://webdevutility.com/api/ip", timeout=5).json()
print(data["ip"], data["version"])
print(data["location"]["city"], data["location"]["country"])
print(data["network"]["organization"], data["network"]["asn"])

Common errors and how to fix them

The address starts with 192.168, 10. or 172.16
That is a private address and never what this page shows. If a program reports it, it is reading the local network interface. The public address is the one assigned by your ISP at the router.
The city is a few hundred kilometers off
IP geolocation is based on where the address block is registered and routed, not on your device. Mobile carriers in particular concentrate traffic in a few cities. Treat the country as reliable and the city as a hint.
The IPv4 box says no route detected
Either your connection is IPv6-only, which some mobile carriers do with a translation layer, or a browser extension blocked the probe. Open the page in a private window with extensions off; if it still says so, give services the IPv6 address or ask your carrier.
The IP changed since yesterday
Dynamic addressing. Most consumer connections rotate the address after a reconnect or lease expiry. For an allowlist that must not break, ask your ISP for a static IP or use a VPN with a dedicated address.
The ISP name is wrong or shows a cloud provider
You are behind a VPN, a corporate proxy, or a carrier that leases address space from another network. The ASN shown is the network that announced your address to the internet, which is what websites see too.

Specifications and references

This tool follows the specifications below. Read them when you need the exact normative wording, for example to settle an edge case between two implementations.

Frequently Asked Questions

Is this my public or private IP?

Public. It is the address the rest of the internet sees for your connection, assigned by your ISP or VPN. Your private address, such as 192.168.1.20, only exists inside your home or office network and is never shown to websites.

Why does it show both an IPv4 and an IPv6 address?

Because your connection has both. Browsers prefer IPv6 when a site offers it, so a dual-stack site only ever sees one of your addresses. The page therefore checks each protocol separately and shows what it finds. If one box says not available, your network has no route for that protocol, which is common for IPv6 on older home routers.

Why is the city wrong?

Location is estimated from the IP block's registration and routing data, not from GPS. Mobile carriers and large ISPs often route traffic through a hub in another city, and a VPN shows its exit server. Country is reliable, city is approximate.

Where does the data come from?

The location, ISP and ASN come from the request itself as it reaches Cloudflare's edge, from routing data and a geolocation estimate for the IP. The IPv4 and IPv6 boxes come from two tiny probes to single-protocol hosts, which return only the address they saw. Nothing is stored.

Does my IP change?

Most home and mobile connections get a dynamic address that can change when the router reconnects or after a lease expires, usually days to weeks. Business lines and servers often have a static IP. If you need a fixed address for an allowlist, ask your ISP for a static one or use a VPN with a dedicated IP.

Related

Find out who owns an address with the WHOIS lookup, check what your resolver should return with the DNS propagation checker, or see how your browser identifies itself with the user agent parser.

More URL Tools

Browse all url tools

Copied to clipboard!