Back

Basics

What Is 127.0.0.1?

Learn what 127.0.0.1 means, why it is called localhost, and how to use it safely when testing services on your own computer.

Published: Sep 17, 20253 min read

127.0.0.1 is the best-known loopback IP address. It points back to the same computer that made the connection, so traffic sent to it never travels through your router, Wi-Fi, or the public internet.

You will often see it written as localhost. When a browser opens http://127.0.0.1:3000, it is asking for a service running on your own device on port 3000.

Why 127.0.0.1 matters

Loopback addresses make it possible to test software locally before exposing it to anyone else. A database, local development server, or monitoring agent can communicate with another program on the same machine without needing a public IP address or internet connection.

For example, a developer might run a website locally and visit:

http://localhost:4321

That request stays on the computer. Other people on the same home network cannot reach it unless the service is deliberately configured to listen on a network address instead.

Is 127.0.0.1 a public or private IP address?

Neither. It is a special-use loopback address. The larger 127.0.0.0/8 range is reserved for this purpose, which means every IPv4 address from 127.0.0.0 through 127.255.255.255 loops back to the local machine.

In practice, 127.0.0.1 is the address most applications use. It is not assigned by your router, and it does not identify you on the internet. For internal home or office addresses such as 192.168.1.20, see Private IP Ranges.

localhost is a hostname. Your operating system usually resolves it to 127.0.0.1 for IPv4 and ::1 for IPv6. The name is convenient because it works even when you do not want to remember the numeric address.

Most of the time, these URLs behave the same:

http://localhost:3000
http://127.0.0.1:3000

There can be small differences when an application supports IPv6, uses a custom hosts file, or applies separate security rules to hostnames. If a local tool works with one address but not the other, check which address family the service is listening on.

What it means when localhost will not connect

An error such as “connection refused” at 127.0.0.1 normally does not mean your internet is down. It usually means there is no application listening on that port, or the application stopped unexpectedly.

Try these basic checks:

  • Confirm the local app or service is running.
  • Confirm you are using the right port, such as 3000, 4321, or 8080.
  • Check whether the service is configured to listen on 127.0.0.1, ::1, or another address.
  • Review the application log for startup errors or port conflicts.

If you are learning the broader network concepts, What Is My IP and Localhost? explains the difference between a loopback address, a private address, and a public address.

Is it safe to use 127.0.0.1?

Usually, yes. Because the connection stays on your device, loopback is a useful default for development tools, local admin panels, and databases that should not be exposed to your network.

However, local does not automatically mean harmless. A browser extension, another user account, or malicious software running on the same computer may still be able to interact with a local service. Keep sensitive services authenticated, avoid running unknown code, and do not assume localhost is a replacement for access control.

127.0.0.1 FAQ

Can someone else access my 127.0.0.1 address?
No. On another device, 127.0.0.1 points back to that other device, not to yours. To share a local app, you must intentionally bind it to a network interface and allow the connection through your firewall.
Does 127.0.0.1 reveal my real IP address?
No. It is a local-only loopback address and is not the public address websites see. Use our [Find My IP](/what-is-my-ip) tool to check the public IP exposed by your current connection.
Why does localhost sometimes resolve to ::1?
::1 is the IPv6 loopback address. Modern systems often support both IPv4 and IPv6, so localhost may use either one depending on the application and system configuration.