Subnet calculator

Enter an IPv4 address with a prefix (/26) or a mask (255.255.255.192). Everything updates as you type, in your browser; nothing is sent anywhere.

IPv4 subnet
Try:
Network address192.168.10.0/26
Broadcast address192.168.10.63
Usable host range192.168.10.1 – 192.168.10.62
Usable hosts62 of 64 addresses
Subnet mask255.255.255.192
Wildcard mask0.0.0.63
Binary mask11111111.11111111.11111111.11000000
Binary address11000000.10101000.00001010.00100101
Hex / decimal0xC0A80A25 · 3232238117
Class · scopeC · Private (RFC 1918)
Reverse zone10.168.192.in-addr.arpa

See the mask split the address

A prefix is just a line drawn across the 32 bits of an address: everything left of it identifies the network, everything right of it numbers the hosts. Drag the slider and watch the line move, the host count double or halve, and the network address change.

Network bits: 26 Host bits: 6 → 26 = 64 addresses

Top row: the address in binary. Bottom row: the mask. AND them and every host bit becomes 0, giving the network address 192.168.10.0; set every host bit to 1 for the broadcast.

Split 192.168.10.0/26 into smaller subnets

#NetworkHost rangeBroadcast
1192.168.10.0/28192.168.10.1 – 192.168.10.14192.168.10.15
2192.168.10.16/28192.168.10.17 – 192.168.10.30192.168.10.31
3192.168.10.32/28192.168.10.33 – 192.168.10.46192.168.10.47
4192.168.10.48/28192.168.10.49 – 192.168.10.62192.168.10.63

Worked example: 192.168.10.37/26

  1. /26 means 26 network bits and 6 host bits. The mask is 255.255.255.192 (the last octet is 11000000 = 192).
  2. Block size in the last octet: 256 − 192 = 64. Blocks start at .0, .64, .128, .192.
  3. 37 falls in the block starting at 0, so the network is 192.168.10.0 and the broadcast is 192.168.10.63.
  4. Usable hosts: .1 to .62, which is 26 − 2 = 62 hosts.

The "block size" shortcut (256 minus the interesting octet of the mask) is how most network engineers do this in their heads. For IPv6 prefixes use the IPv6 subnet calculator; to turn an arbitrary range into CIDR blocks use the CIDR calculator.

Questions people ask

How do I calculate a subnet?
Convert the address and mask to binary and AND them: that gives the network address. Set all host bits (the 32 − prefix bits on the right) to 1 for the broadcast. Usable hosts are 2host bits − 2, because the network and broadcast addresses can't be assigned to hosts.
How many hosts are in a /24?
256 addresses, 254 usable (x.x.x.1 to x.x.x.254). A /25 has 126 usable, a /26 has 62, a /27 has 30, a /28 has 14, a /29 has 6, a /30 has 2. See the full subnet cheat sheet.
What about /31 and /32?
A /31 has two addresses and, per RFC 3021, both are usable on point-to-point links (no network or broadcast). A /32 is a single host, used for loopbacks and host routes.
What is the difference between a subnet mask and CIDR?
They express the same thing. 255.255.255.0 has 24 one-bits, so it's written /24 in CIDR notation. Masks must be contiguous ones followed by zeros.
Do IP classes (A, B, C) still matter?
Not for routing. Classful addressing was replaced by CIDR in 1993 (RFC 1519). The class is shown for reference because exams and older documentation still use it.