Check whether an IP address belongs to a CIDR network prefix.
The frame below runs the same code as this page, in the reader's own browser. Nothing is sent to us, and nothing is sent to you.
Pick a dark background and the text and panels follow it, so the frame stays readable on a dark page.
Address and network become fixed-width bits; applying the mask to the address and comparing the prefix determines membership. IPv4 and IPv6 use separate widths and parsers.
Input1: 192.168.1.50 Input2: 192.168.1.0/24
IP: 192.168.1.50 CIDR: 192.168.1.0/24 Is in range: yes Network address: 192.168.1.0 Broadcast address: 192.168.1.255
Firewalls, routers, and cloud security rules check subnet membership.