Guide
What is 127.0.0.1?
127.0.0.1 is the loopback address — your own device. Learn how localhost works, how it differs from your LAN and public IP, and why developers see it in logs.
On this page
If you have ever started a development server and been told to open http://127.0.0.1:8000, or seen 127.0.0.1 in a log file, you have met the loopback address: a network address that always means "this very device".
The loopback address
127.0.0.1 is the IPv4 loopback address — the standard way for a machine to talk to itself. Traffic sent there never touches a network card, router or cable; the operating system's network stack turns it around and delivers it back to the same machine. The entire 127.0.0.0/8 range behaves this way, and localhost is the hostname that resolves to it (by convention in the hosts file) — see subnet masks and CIDR for what /8 means.
In IPv6 the equivalent is ::1. Everything else in that address family is routed normally; only the single address is loopback.
Why 127.0.0.1 and not something else
The address was reserved deliberately so that every machine has a guaranteed, standard self-address, with no configuration and no chance of a collision with a real host. Software can therefore bind to loopback and be reachable only locally, which is exactly what a development server or a local database should do until you decide otherwise — a detail with real security consequences, as port forwarding shows when misconfigured.
127.0.0.1 vs LAN IP vs public IP
| Address | Meaning | Who can connect |
|---|---|---|
127.0.0.1, ::1 | Loopback — this device | Only the device itself |
192.168.1.24, 10.0.0.7 | Private LAN address | Anything on the same network — see local IP addresses |
203.0.113.45 | Public address, from the ISP | Anyone on the internet, subject to your firewall — see public vs private |
The checker shows the third one because that is what websites see. If a lookup ever reports 127.0.0.1 for a remote site, something is wrong — either the request is being intercepted by a proxy on your machine or the log is recording the wrong end of the connection.
Where it shows up in practice
- Development servers:
python3 -m http.server 8080binds to all interfaces by default; frameworks often default to loopback for safety. - Local databases and APIs: binding MySQL, Postgres, Redis or Docker ports to loopback keeps them off the network.
- Hosts-file blocking: mapping an ad domain to
127.0.0.1sends the request nowhere — an old but effective DNS technique. - Logs and error pages: a web app behind a reverse proxy often records
127.0.0.1because the proxy, running on the same machine, is the client — the real visitor's address is in a forwarded header, which is why geolocation code must read the right field. - Diagnostics:
ping 127.0.0.1proves the TCP/IP stack is alive; if it fails, the problem is your machine, not the network.
0.0.0.0 and ::1
Watch out for 0.0.0.0, which is not loopback: as a destination it means "this network" or "any address", and as a bind address it means "listen on every interface". A service bound to 0.0.0.0 is reachable from your LAN and potentially the internet, unlike one bound to 127.0.0.1. That single character of difference is a recurring source of exposed databases.
Bottom line: 127.0.0.1 is your device speaking to itself — private by construction, invisible to the network, and the default home of every local service. It is never the address a website sees, and it is never your public IP.
Frequently asked questions
Is 127.0.0.1 my IP address?
It is a valid IP address for your machine, but it is the loopback — usable only by the machine itself. Your public IP, the one websites see, is different and comes from your ISP.
What is the difference between 127.0.0.1 and 0.0.0.0?
127.0.0.1 is loopback: local-only. 0.0.0.0 as a bind address means listen on all interfaces, making the service reachable from the network. Binding to 0.0.0.0 by accident is a common way to expose a database.
Why does my server log show 127.0.0.1 instead of visitors' IPs?
Because a reverse proxy on the same host is connecting to it, so the immediate client really is loopback. Read the X-Forwarded-For header (and configure the proxy to set it) to get the real visitor address.
Keep reading
- MAC address vs IP address
- Subnet masks and CIDR explained
- What is port forwarding?
- How to fix an IP address conflict
- What is a DNS server?
- How to tell if someone is using your Wi-Fi
- Tor vs VPN
- Is an IP address personal data?
- Does a VPN slow down your internet?
- Check your IP address from the command line
- Are free VPNs safe?
- Why is my IP location wrong?
- Browse all IP guides
- Check my public IP address
Check any other IP address
Investigating a suspicious login, a spam email header or a server log entry? Run any IPv4 or IPv6 address through the same geolocation and proxy checks.