Subnet Calculator: IPv4 CIDR, Mask and Host Range

Enter an IPv4 address and a CIDR prefix or subnet mask and see the network address, broadcast address, first and last usable host, wildcard mask, total addresses and usable hosts. You can also split a network into equal subnets. All calculations run in your browser.

Related Tools

Number Base Converter Chmod Calculator Cron Expression Parser URL Encoder & Decoder Text to Binary Translator All Utilities

What is a subnet?

A subnet is a smaller network inside a larger one. An IPv4 address has 32 bits, and a subnet mask or CIDR prefix says how many of those bits identify the network and how many identify the device. Splitting a network into subnets keeps traffic organized, improves security by separating groups of devices and makes better use of a limited supply of addresses.

Network engineers, cloud architects, students preparing for networking exams and anyone setting up a home lab need to work out subnet details regularly. This calculator does it instantly and shows the binary form to help you learn how it works.

How to calculate a subnet

  1. Enter the IPv4 address, for example 192.168.1.10.
  2. Enter the CIDR prefix, such as 24, or type the subnet mask, such as 255.255.255.0.
  3. Read the network address, broadcast address, usable host range and number of hosts.
  4. Choose Split into subnets to divide the network into smaller equal parts.
  5. Use the binary view to see how the mask divides the address.

CIDR notation explained

CIDR (Classless Inter-Domain Routing) notation writes the network as an address followed by a slash and the number of network bits, as in 192.168.1.0/24. A /24 has 24 network bits and 8 host bits, which gives 256 addresses. Two of them are reserved: the first is the network address and the last is the broadcast address, leaving 254 usable hosts.

The formula for usable hosts is 2 to the power of the host bits, minus 2. Special cases exist: a /31 has two usable addresses for point-to-point links (RFC 3021), and a /32 is a single host.

Private IP ranges

  • 10.0.0.0/8 (10.0.0.0 to 10.255.255.255): large private networks.
  • 172.16.0.0/12 (172.16.0.0 to 172.31.255.255): medium private networks.
  • 192.168.0.0/16 (192.168.0.0 to 192.168.255.255): home and small office networks.
  • These ranges are not routed on the public internet and are reused by millions of local networks.

Classful addressing and why it matters less today

Older networking texts divide addresses into classes: A (first octet 1 to 126), B (128 to 191) and C (192 to 223) with default masks of /8, /16 and /24. The calculator shows the class for reference, but modern networks use CIDR, where any prefix length can be used regardless of the first octet. Class information is mostly useful for exams and for understanding older documentation.

Example: planning an office network

Say you have the private network 192.168.10.0/24 and need four separate groups: staff, guests, servers and printers. Choose Split into subnets of /26 and the tool lists 192.168.10.0/26, 192.168.10.64/26, 192.168.10.128/26 and 192.168.10.192/26. Each has 62 usable hosts, which is more than enough for a small office. Giving each group its own subnet lets you apply different firewall rules to each one.

Common CIDR prefixes

CIDR Subnet mask Usable hosts
/8 255.0.0.0 16,777,214
/16 255.255.0.0 65,534
/24 255.255.255.0 254
/25 255.255.255.128 126
/26 255.255.255.192 62
/27 255.255.255.224 30
/28 255.255.255.240 14
/29 255.255.255.248 6
/30 255.255.255.252 2

Frequently Asked Questions

How many hosts are in a /24 network?

256 addresses in total, and 254 usable hosts.

What is a wildcard mask?

The inverse of the subnet mask, used in access lists and routing protocols. For 255.255.255.0 it is 0.0.0.255.

What are the network and broadcast addresses?

The first address of a subnet identifies the network and the last is used to reach all hosts on it. Neither is assigned to a device.

How do I convert a subnet mask to CIDR?

Count the number of 1 bits in the mask. 255.255.255.0 has 24, so it is /24.

Does it support IPv6?

No. This calculator is for IPv4 only.

What is a /31 or /32 network?

A /31 has two usable addresses for point-to-point links, and a /32 is a single host address.

Is anything sent to a server?

No. The calculation runs in your browser.