Back

Networking

The Loopback IP Range Explained

Understand the 127.0.0.0/8 loopback range, how it differs from private and public IPs, and why local services use it for safe testing.

Published: Sep 17, 20253 min read

The IPv4 loopback range is 127.0.0.0/8. It is reserved so a computer can send network traffic back to itself. The traffic is handled by the operating system’s networking stack and never leaves the device.

The familiar address 127.0.0.1 is only one address inside that range. The whole block, from 127.0.0.0 to 127.255.255.255, has loopback behavior.

What the /8 means

In CIDR notation, /8 means the first eight bits identify the network. That leaves the remaining bits available for addresses inside the block.

IPv4 loopback127.0.0.0/8IPV4Public
Range Start
127.0.0.0
Range End
127.255.255.255
Address Count
16,777,216
Prefix
/8

You generally should not assign addresses from this range to a router, server, or local network. They are reserved by design, and systems treat them differently from ordinary addresses.

How loopback differs from private IP addresses

Loopback, private, and public addresses all serve different jobs:

  • Loopback: refers to the same device. Example: 127.0.0.1.
  • Private IP: identifies a device inside a home, office, or cloud network. Example: 192.168.1.25.
  • Public IP: identifies the internet-facing connection or host. Example: 8.8.8.8.

A private IP can travel across a local network. A loopback IP cannot even reach your router. It stays on the exact device that originated the request. Read Private IP Ranges for the internal ranges used on real networks.

IPv6 has a loopback address too

IPv6 uses a single loopback address:

::1

Like 127.0.0.1, ::1 means “this computer.” The hostname localhost may resolve to either address depending on which protocol an application prefers. This is one reason a local service can occasionally work at 127.0.0.1 but not at localhost, or the other way around.

For a practical overview of the two protocols, see IPv4 vs IPv6.

Why software uses loopback

Loopback is useful because it creates a network-like connection without exposing a service to other devices. Common examples include:

  • A development server running on 127.0.0.1:3000.
  • A database that accepts connections only from the same machine.
  • A local proxy or VPN helper that your browser connects to.
  • Automated tests that need a predictable address without using a real network.

Binding a service to loopback is often a safer default than binding to every available network interface. It reduces accidental exposure while you are developing or testing.

A simple way to test loopback

If a local web service is running on port 8080, you can request it from the same device:

http://127.0.0.1:8080

If the request fails, first verify that the service is running and listening on that port. If it is listening only on IPv6, try http://[::1]:8080 instead. A loopback connection failure is usually an application configuration issue, not an ISP or Wi-Fi problem.

Security notes

Loopback prevents remote devices from connecting directly to a service, but it is not a complete security boundary. Software on the same computer may still be able to connect. Local services should still validate requests, protect sensitive actions, and keep secrets out of browser-accessible endpoints.

If you want to understand the common single-address form before exploring the entire range, start with What Is 127.0.0.1?.

Loopback range FAQ

Is every 127.x.x.x address localhost?
Yes. The full IPv4 range 127.0.0.0/8 is reserved for loopback. 127.0.0.1 is simply the conventional address most people use.
Can I use 127.0.0.2 for a local test?
Yes, operating systems normally treat it as loopback too. Some tools, however, assume 127.0.0.1 by default, so use the conventional address unless you specifically need a separate local endpoint.
Is localhost the same as my private IP address?
No. Localhost always points to the device you are using. A private IP identifies a device on a local network and can be reached by other permitted devices on that network.