IPv4 Subnet Calculator (CIDR)

Perform classless subnet routing calculations on IPv4 blocks. Input an IP address and select a CIDR prefix to decode the subnet mask, network boundaries, usable host address range, broadcast address, and class type. Visualizes octet boundaries in binary format.

Load Subnet Examples:
Network Address
โ€”
Broadcast Address
โ€”
Dotted Subnet Mask
โ€”
Wildcard Mask
โ€”
Usable Host IP Range
โ€”
Usable Hosts Count
โ€”
Network Classification
โ€”

Binary Bit Representation

Type Octet 1Octet 2Octet 3Octet 4
Address: โ€”
Mask: โ€”
Network: โ€”
Broadcast: โ€”

๐Ÿ› ๏ธ Networking Best Practices

  • Local Subnet Ranges: When designing your internal LAN or cloud VPCs, utilize the RFC 1918 private address ranges: Class A (`10.0.0.0/8`), Class B (`172.16.0.0/12`), or Class C (`192.168.0.0/16`).
  • IP Reserve Margins: Always budget for growth. An office with 40 hosts needs a subnet size of at least `/26` (62 hosts) instead of a `/27` (30 hosts) to avoid dynamic IP exhaust.
  • Gateways Selection: In standard networking topologies, the first usable IP address (e.g. `.1`) or the last usable IP (e.g. `.254`) is mapped to the local router interface acting as the default gateway.

The logic of classless inter-domain routing

Classless Inter-Domain Routing (CIDR) replaced the older classful networking standard, which was based on fixed Class A, B, and C address block divisions. The legacy system led to substantial IP address waste since organisations were often forced to lease entire Class B blocks (65,536 addresses) even if they only needed a fraction of that allocation. CIDR introduced variable-length subnet masking (VLSM), allowing administrators to partition networks down to the bit-level to fit precise requirements. A `/24` represents a standard local network, while a `/30` provides exactly 2 usable host addresses, ideal for point-to-point connections between routers without waste.

โš ๏ธ Common Mistakes to Avoid

  • Miscalculating usable hosts: Remember that the first address (network ID) and the last address (broadcast) are reserved and cannot be assigned to hosts.
  • Confusing CIDR shorthand: Subnets like /24 represent 256 addresses, but /25 halves that to 128, and /23 doubles it to 512.
  • Ignoring IP class boundaries: Classless Inter-Domain Routing (CIDR) replaces the old Class A, B, C network system, allowing flexible subnet sizes.

Frequently asked questions

What is a subnet mask?

A subnet mask is a 32-bit number used to divide an IP address into network and host portions, defining the boundaries of a local network.

Why are the network and broadcast addresses unusable?

The network address identifies the network itself, while the broadcast address is used to send data to all hosts on that network simultaneously. Assigning them to a single device causes routing failures.

What does CIDR stand for?

CIDR stands for Classless Inter-Domain Routing. It is a system for allocating IP addresses and routing IP packets that allows variable-length subnet masking.