CalculatorsConvertersDeveloperTextAll toolsDirectory
Submit your tool Sign in
Theme
Home/Answers/Network
How-to

How do I check if two IP addresses are in the same subnet?

Short answer

Run each IP with the shared CIDR prefix through a browser-based subnet calculator and compare the network address it returns; if both give the same network address, they are in the same subnet. It runs on your device with nothing uploaded.

Same subnet means same network address

Two IP addresses belong to the same subnet when, under the same prefix, they share the same network address. The prefix decides how many leading bits count as the network portion, and the subnet calculator applies that mask to each IP to reveal its network address. If the two network addresses match, the hosts can reach each other directly without a router; if they differ, traffic has to be routed.

Compare without exposing your addressing

A client-side subnet calculator does the masking in your browser, so you can compare private addresses without sending them to a server. Enter the first IP with the prefix, note its network address, then do the same for the second IP and compare. It is free and needs no account.

Step by step

  1. Open the calculator. Open the subnet and CIDR calculator in your browser.
  2. Check the first IP. Enter the first IP with the shared CIDR prefix and note its network address.
  3. Compare the second IP. Enter the second IP with the same prefix and compare the network addresses; a match means the same subnet.

Frequently asked questions

How do I tell if two IPs share a subnet?

Apply the same prefix to both and compare their network addresses; matching means the same subnet.

Does the prefix matter?

Yes. The same two IPs can be in one subnet under one prefix and different subnets under another.

Are the addresses uploaded?

No. The calculation runs in your browser, so nothing is sent to a server.

Related answers