ShareYourGroupShareYourGroupSubnet and Ports

Is this IP in this subnet?

Type an address and a block. The answer is yes or no, with the block's range shown.

How the test works

An address is inside a block when its first n bits (n is the prefix length) are the same as the block's first n bits. The tool applies the mask of the block to both and compares: this is exactly what a router or a firewall does.

Examples that surprise people

Try them in the tool above to see the range of each block.

Where you need it

Common mistakes

  1. Comparing only the first number. 10.x.x.x is inside 10.0.0.0/8, but 11.x.x.x is not.
  2. Forgetting that the prefix decides the range. 10.20.0.0/16 holds 10.20.0.0 to 10.20.255.255, not the whole 10.x range.
  3. Testing against a block written with a host address (10.20.30.40/16). The block is the one that contains it: 10.20.0.0/16.
Does the tool support IPv6?

This version tests IPv4 addresses. For IPv6 use the IPv6 calculator and compare the first and last address.

What if my address has leading zeros?

Leading zeros are refused, because some programs read them as octal numbers.

This is an independent guide. It is not connected with IANA, the IETF or any network equipment maker. Address and port data come from the IANA registries as fetched on 14 November 2026; RFC texts were read from rfc-editor.org. Check the originals for anything you rely on.