What is 127.0.0.1 (localhost)?
127.0.0.1 is the loopback address. It always points back to the device you are using, so a request to it never leaves your computer. Its usual name is localhost.
What loopback means
The whole 127.0.0.0/8 range is reserved for loopback, but 127.0.0.1 is the one people use. IPv6 has its own, written ::1. Traffic to these addresses stays inside your device and does not touch your network or the internet.
What it is used for
- Developers run a website or tool on their own machine and open it at http://localhost:3000.
- Programs on the same device talk to each other, such as an app and its database.
- Testing: if a request to 127.0.0.1 works, the network software on the device is working.
What the port number is
You often see a colon and a number after it, such as 127.0.0.1:8080. The number is the port, which picks one service among several running on the same device.
Is it safe?
Services listening only on 127.0.0.1 cannot be reached from other devices, which makes it a safe place to run something privately. A service bound to 0.0.0.0 listens on every network interface, which is a different thing.
Common questions
Is localhost the same as 127.0.0.1?
Yes in practice. Localhost is the name that normally points to 127.0.0.1, and to ::1 on IPv6.
Why does 127.0.0.1 show a different result on someone else’s computer?
Because it always means the device you are on. Everyone’s own computer is 127.0.0.1 to itself.
Can I reach 127.0.0.1 from another computer?
No. From another device, 127.0.0.1 means that device. To reach yours, use its private network address.