Skip to content
devfocus.app

CIDR / Subnet Calculator

Learn how it works

Get the network, broadcast, host range, mask and size of IPv4 and IPv6 CIDR blocks, and check if an address is inside.

Block

192.168.1.10 is a host in the block. The network address is 192.168.1.0, so the block is 192.168.1.0/24.

Network
192.168.1.0/24
Netmask
255.255.255.0
Wildcard mask
0.0.0.255
Cisco ACL / OSPF
Network address
192.168.1.0
Broadcast address
192.168.1.255
First usable host
192.168.1.1
Last usable host
192.168.1.254
Usable hosts
254
Total addresses
256
28
Prefix length
/24
Address class
C
Type
Private (RFC 1918)
192.168.0.0/16
Hex
0xC0A8010A
Integer
3232235786
Address in binary (network | host)
11000000.10101000.00000001|00001010
Netmask in binary (network | host)
11111111.11111111.11111111|00000000
How it’s worked out
  1. Step 1: Write the netmask. /24 means the first 24 of the 32 bits are network bits. Write them as 1s, then turn each octet into decimal.

    /24 = 8 + 8 + 8 one-bits
    netmask = 255.255.255.0
  2. Step 2: The prefix ends on an octet boundary. The mask is only 255s and 0s, so keep the first 3 octets and set the rest to 0 (first address) or 255 (last address).

    mask 255.255.255.0
    address 192.168.1.10
  3. Step 3: List the usable hosts. The first address names the network and the last is the broadcast, so the hosts are everything in between.

    network   192.168.1.0
    first     192.168.1.1
    last      192.168.1.254
    broadcast 192.168.1.255
  4. Step 4: Count the addresses. Each host bit doubles the block. Take away 2 for the network and broadcast addresses.

    32 − 24 = 8 host bits
    2^8 = 256 addresses
    256 − 2 = 254 usable hosts

Learn how this works or open the subnet cheat sheet.

Is this address in the block?

Split into subnets

From /24 to /32.