Subnet Calculator โ€” CIDR, Subnet Mask & Host Range

This free subnet calculator works out the network address, broadcast address, subnet mask, and usable host range for any IPv4 address in CIDR notation. A prefix like /24 fixes the first 24 bits as the network, leaving 8 host bits โ€” 256 addresses, of which 254 are usable after the network and broadcast addresses are reserved. Use it to plan subnets, size address blocks, and avoid overlaps. All calculations run locally in your browser, so nothing you enter about your network is uploaded.

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.

192.168.1.0/24 โ€” 32 address bitsโ—€ 24 network bits โ–ถโ—€ 8 host bits = 254 hosts โ–ถ
A /24 fixes the first 24 bits as the network, leaving 8 host bits โ€” 256 addresses, 254 usable after the network and broadcast addresses.

Reading CIDR notation

An address like 192.168.1.0/24 uses CIDR: the /24 says the first 24 bits are the network portion, leaving 8 bits for hosts. Those 8 host bits give 2โธ = 256 addresses, but the first (network) and last (broadcast) are reserved, so 254 usable hosts remain. Every smaller prefix doubles the network's size: a /23 spans 512 addresses, a /25 just 128.

Mask, network and broadcast

The subnet mask is the prefix written as four octets โ€” /24 is 255.255.255.0. ANDing an address with its mask yields the network address; setting all host bits to 1 yields the broadcast. Hosts can only talk directly to others sharing the same network address; anything outside must go through a gateway.

Why subnet at all

Splitting a large block into smaller subnets limits broadcast traffic, isolates departments for security, and conserves scarce IPv4 space by handing each segment only as many addresses as it needs. A point-to-point link, for instance, uses a /30 (two usable hosts) rather than wasting a full /24.

โš ๏ธ 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.

Related guides

IP Subnetting & CIDR Guide โ†’
Reviewed by the ToolsmithPro editorial team ยท Last updated June 2026. Every calculation and conversion runs entirely in your browser โ€” your inputs are never uploaded, stored or shared. Formulas and methodology are documented on our about page; spot an error? tell us and we'll fix it.