Skip to content
ENExplore Calculators

Subnet Calculator

Divide an IP network into subnets and view addressing details for each resulting subnet.

About Subnet Calculator

The subnet mask (from the CIDR prefix) is applied to the IP address with a bitwise AND to find the network address, and the inverse (wildcard) mask gives the broadcast address. Usable hosts equal the total addresses in the block minus the network and broadcast addresses — except /31 links (RFC 3021, 2 hosts) and /32 (a single host).

Formulas

Network and broadcast address

network = ip AND mask ; broadcast = network OR NOT mask

ip
The 32-bit address, as four octets
mask
The subnet mask derived from the CIDR prefix
~mask
The wildcard (inverse) mask

Usable host count

hosts = 2^(32 − cidr) − 2

cidr
Prefix length — the number of leading 1-bits in the mask
− 2
Excludes the network and broadcast addresses; /31 and /32 are exceptions

Worked example

With the default values below, Subnet Calculator returns Network Address of 192.168.1.0 /24. Change any input above and every figure here is recalculated in your browser.

Inputs used

Network Classone of Any, A, B, C
Any
Subnetone of 255.255.255.255 /32, 255.255.255.254 /31, 255.255.255.252 /30, 255.255.255.248 /29, 255.255.255.240 /28, 255.255.255.224 /27, 255.255.255.192 /26, 255.255.255.128 /25, 255.255.255.0 /24, 255.255.254.0 /23, 255.255.252.0 /22, 255.255.248.0 /21, 255.255.240.0 /20, 255.255.224.0 /19, 255.255.192.0 /18, 255.255.128.0 /17, 255.255.0.0 /16, 255.254.0.0 /15, 255.252.0.0 /14, 255.248.0.0 /13, 255.240.0.0 /12, 255.224.0.0 /11, 255.192.0.0 /10, 255.128.0.0 /9, 255.0.0.0 /8, 254.0.0.0 /7, 252.0.0.0 /6, 248.0.0.0 /5, 240.0.0.0 /4, 224.0.0.0 /3, 192.0.0.0 /2, 128.0.0.0 /1, 0.0.0.0 /0
255.255.255.0 /24
Subnetone of 255.255.255.252 /30, 255.255.255.248 /29, 255.255.255.240 /28, 255.255.255.224 /27, 255.255.255.192 /26, 255.255.255.128 /25, 255.255.255.0 /24, 255.255.254.0 /23, 255.255.252.0 /22, 255.255.248.0 /21, 255.255.240.0 /20, 255.255.224.0 /19, 255.255.192.0 /18, 255.255.128.0 /17, 255.255.0.0 /16, 255.254.0.0 /15, 255.252.0.0 /14, 255.248.0.0 /13, 255.240.0.0 /12, 255.224.0.0 /11, 255.192.0.0 /10, 255.128.0.0 /9, 255.0.0.0 /8
255.0.0.0 /8
Subnetone of 255.255.255.252 /30, 255.255.255.248 /29, 255.255.255.240 /28, 255.255.255.224 /27, 255.255.255.192 /26, 255.255.255.128 /25, 255.255.255.0 /24, 255.255.254.0 /23, 255.255.252.0 /22, 255.255.248.0 /21, 255.255.240.0 /20, 255.255.224.0 /19, 255.255.192.0 /18, 255.255.128.0 /17, 255.255.0.0 /16
255.255.0.0 /16
Subnetone of 255.255.255.252 /30, 255.255.255.248 /29, 255.255.255.240 /28, 255.255.255.224 /27, 255.255.255.192 /26, 255.255.255.128 /25, 255.255.255.0 /24
255.255.255.0 /24
IP Address
192.168.1.10

Results

Network Address
192.168.1.0 /24
Note
Broadcast Address
192.168.1.255
Usable Host Range
192.168.1.1 – 192.168.1.254
Usable Hosts
254
Total Addresses
256
Subnet Mask
255.255.255.0
Wildcard Mask
0.0.0.255
CIDR Notation
/24
Short
192.168.1.0/24
IP Class
Class C
Address Type
Private
Binary Subnet Mask
11111111.11111111.11111111.00000000
Binary IP
11000000.10101000.00000001.00001010
Binary ID
11000000101010000000000100001010
Hex ID
0xC0A8010A
Integer ID
3232235786
in-addr.arpa (reverse DNS)
10.1.168.192.in-addr.arpa
IPv4-Mapped IPv6 Address
::ffff:c0a8:010a
6to4 Prefix
2002:c0a8:010a::/48

Step by step

  1. 1Read the /24 prefix from the subnet list= 255.255.255.0 (11111111.11111111.11111111.00000000)
  2. 2AND the address with the mask to get the network= 192.168.1.0
  3. 3OR the network with the wildcard to get the broadcast= 192.168.1.255
  4. 4Count the addresses in the block= 256
  5. 5Subtract the unusable addresses= 254 usable hosts

Assumptions and limits

  • The result is derived only from the 6 inputs listed above. Anything not among them is not part of the calculation.
  • In particular, this calculator does not take inflation, tax, fees or charges or compounding frequency into account.
  • Figures are rounded for display to whole numbers, so totals built from several rounded parts can differ slightly from the unrounded arithmetic.

How these calculators are built and tested is described on the Methodology page. If a figure looks wrong, please report it.

Subnet Calculator — full guide

What a subnet mask actually does

An IPv4 address is 32 bits. A subnet mask splits those 32 bits into a network portion and a host portion. Every address that shares the same network portion is on the same local network and can be reached without a router.

The mask is a run of 1-bits followed by a run of 0-bits, which is why 255.255.255.0 and /24 mean the same thing: 24 leading ones. The slash notation is called CIDR, and it is what routers, cloud consoles and firewall rules generally want. Dotted masks survive mostly in Windows dialogs and older equipment.

The four numbers that define a subnet

For 192.168.10.0/24:

  1. Network address — 192.168.10.0, the identifier for the subnet. Obtained

by ANDing any address in the block with the mask.

  1. Broadcast address — 192.168.10.255, reaches every host at once.

Obtained by ORing the network with the inverted mask.

  1. Usable range — 192.168.10.1 to 192.168.10.254. Everything between

the two above.

  1. Host count — 2^(32 − prefix) total, minus the network and broadcast, so

254 here.

Why you lose two addresses (and when you don't)

The first address names the network and the last is the broadcast, so neither can be assigned to a machine. There are two exceptions worth knowing:

  • /31 — RFC 3021 permits both addresses to be used on a point-to-point link,

giving 2 usable hosts from 2 addresses. Widely used on router-to-router links.

  • /32 — a single host route. Common for loopbacks and for pinning a specific

address in an ACL or route table.

Prefix cheat sheet

CIDRMaskTotalUsableTypical use
/30255.255.255.25242Point-to-point links
/29255.255.255.24886Tiny device VLAN
/28255.255.255.2401614Small server pool
/24255.255.255.0256254Standard office LAN
/22255.255.252.010241022Large flat network
/16255.255.0.06553665534Whole site or VPC

Network classes, and why they mostly don't matter now

Classes A, B and C fixed the network/host split at 8, 16 and 24 bits. That system was replaced by CIDR in 1993 because it wasted enormous quantities of address space — an organisation needing 300 addresses had to take a Class B of 65,536.

Classes survive in two places: as vocabulary ("it's a class C network", usually meaning a /24), and in the default masks some tools still assume. The class selector in this calculator exists for that reason. A prefix that disagrees with the address's historical class is completely legitimate under CIDR, which is why a mismatch here produces a note rather than an error.

Private ranges worth memorising

  • 10.0.0.0/8 — 16.7 million addresses
  • 172.16.0.0/12 — 1 million addresses
  • 192.168.0.0/16 — 65,536 addresses
  • 169.254.0.0/16 — link-local, self-assigned when DHCP fails
  • 127.0.0.0/8 — loopback

Seeing a 169.254.x.x address on a machine almost always means DHCP did not answer.

Planning subnets without regret

Size for the network you will have in three years, not the one you have today, and leave gaps between allocations so a block can grow without renumbering. Renumbering a live network is genuinely painful, and address space inside a private range is effectively free — being generous costs nothing.

For IPv6 planning, see the IPv6 subnet calculator.

Guides that use this calculator

Frequently Asked Questions

What does the CIDR prefix (/24) mean?

The prefix is how many leading bits of the address identify the network. /24 means the first 24 bits are the network portion (mask 255.255.255.0), leaving 8 bits — 256 addresses, 254 usable — for hosts.

Why are two addresses not usable?

In a normal subnet the first address is the network identifier and the last is the broadcast address, so neither can be assigned to a host. A /31 is the exception, used for point-to-point links where both addresses are usable.

What's the wildcard mask for?

The wildcard mask is the bitwise inverse of the subnet mask. It's commonly used in access control lists (ACLs) and OSPF configuration on routers to match ranges of addresses.

What does the Network Class selector do?

It filters the subnet list to the prefixes that are valid for that class: /8–/30 for Class A, /16–/30 for Class B, /24–/30 for Class C. Choose "Any" to work in pure CIDR terms with every prefix from /0 to /32 available, including /31 point-to-point links and /32 host routes. If the address you enter doesn't match the class you picked, the result still calculates correctly and adds a note — modern CIDR routing doesn't require the two to agree.

Why does the subnet dropdown show both a mask and a slash number?

They are two notations for the same thing. 255.255.255.0 and /24 both mean "the first 24 bits identify the network". Older equipment and Windows dialogs ask for the dotted mask; routers, cloud consoles and firewall rules usually want the CIDR prefix, so both are shown together.

Subnet Calculator – Calculate Network Address | Calcrivo