Interactive Tool

Subnet Calculator

Use it as an IP address calculator or a CIDR calculator: enter an IPv4 address with a prefix or mask to get the network, broadcast, host range and binary view, then split it.

  • /0 to /32 every prefix
  • 25 prefixes in the cheat sheet

Calculate a Subnet

For example 192.168.10.37/27 or 192.168.10.37 255.255.255.224

Results for 192.168.10.37/27
Network address192.168.10.32/27
Broadcast address192.168.10.63
Usable host range192.168.10.33 to 192.168.10.62
Usable hosts30
Total addresses32
Subnet mask255.255.255.224 (/27)
Wildcard mask0.0.0.31
Block size32 in octet 4
Address typePrivate (RFC 1918); historical class C

Binary view

Address11000000.10101000.00001010.00100101
Mask11111111.11111111.11111111.11100000
Network11000000.10101000.00001010.00100000

Network bits (27) Host bits (5)

Split This Network

Split by

4 subnets of /29 (2 bits borrowed), 6 usable hosts each.

#SubnetUsable rangeBroadcast
1192.168.10.32/29192.168.10.33 to 192.168.10.38192.168.10.39
2192.168.10.40/29192.168.10.41 to 192.168.10.46192.168.10.47
3192.168.10.48/29192.168.10.49 to 192.168.10.54192.168.10.55
4192.168.10.56/29192.168.10.57 to 192.168.10.62192.168.10.63

Want to do this by hand? Try the subnetting practice problems

This is a subnet calculator that also does the jobs people look for as an IP address calculator or a CIDR calculator. Type an address with a prefix, such as 192.168.10.37/27, and it returns the network, broadcast, host range, masks and binary view for the subnet it sits in. Results update as you type. When you press Calculate, the page address picks up your input, so a link to it opens the same result. The subnetting practice problems use the same engine.

How to Read the Results

Each row of the results table answers one question about the subnet. Here is what each one means, with the values for 192.168.10.37/27.

Network address

192.168.10.32/27

The first address in the subnet, with every host bit set to 0. It names the subnet and can't be given to a device, except in a /31 or /32 (see below).

Broadcast address

192.168.10.63

The last address, with every host bit set to 1. A packet sent here reaches every host in the subnet. /31 and /32 subnets have none.

Usable host range

192.168.10.33 to 192.168.10.62

The first and last addresses you can assign to devices, normally the network plus one through the broadcast minus one.

Usable hosts

30

How many devices fit. A /27 holds 30, a /24 holds 254.

Mask and wildcard

255.255.255.224 · 0.0.0.31

The prefix written as an address, and its inverse.

Block size

32 in octet 4

256 minus the mask in the octet where the prefix ends. Subnets of this size start at every multiple of it, which is the shortcut the practice page teaches.

Binary view

27 network bits · 5 host bits

The address in 32 bits, with the network bits and host bits marked so you can see where the prefix falls.

Address type

Private (RFC 1918); class C

Whether the address is private (RFC 1918), loopback, link-local, carrier-grade NAT, documentation, multicast or public, plus the historical class.

CIDR Calculator Basics: How Prefixes Work

Classless Inter-Domain Routing, defined today in RFC 4632, replaced the old class A, B and C networks. Instead of three fixed sizes, a prefix of any length from /0 to /32 sets where the network part ends. That’s why the calculator lists the historical class only for reference: an address starting with 10 is “class A” by its first bit, but 10.1.2.0/24 is simply a /24.

Each bit added to the prefix halves the subnet. A /24 has 256 addresses, a /25 has 128 and a /26 has 64. In the other direction, a /16 has 65,536 addresses and a /8 has 16,777,216. The cheat sheet below lists every prefix from /8 to /32.

Private Address Ranges

The calculator labels these ranges, each set aside by its own RFC. The three private ranges are the ones a home router typically hands out.

10.0.0.0/8172.16.0.0/12192.168.0.0/16

Private

RFC 1918

Set aside for private networks, which internet routers are not meant to carry. Home routers typically hand out addresses from these ranges and use network address translation to reach the internet.

127.0.0.0/8

Loopback

RFC 1122

Reserved for addresses that stay inside the device itself.

169.254.0.0/16

Link-local

RFC 3927

A device with no other address configuration, such as one that gets no answer from a DHCP server, may give itself one of these, so seeing one usually means DHCP failed.

100.64.0.0/10

Shared Address Space

RFC 6598

Set aside for providers running carrier-grade NAT, which puts many customers behind a few public addresses.

192.0.2.0/24198.51.100.0/24203.0.113.0/24

Documentation

RFC 5737

Reserved for examples in books and manuals.

What /31 and /32 Prefixes Mean

Normal subnets lose two addresses to the network and broadcast. On a link between exactly two routers, that wastes half of a /30. RFC 3021 lets a /31 carry the link instead: both addresses are usable, and neither is a broadcast. The calculator shows a /31 with two usable hosts, a host range that runs from the network address to the next address, and no broadcast address.

A /32 is a single address. It appears in routing tables as a route to one host, and on routers as the address of a loopback interface. The calculator shows it as one usable host, with the network address, first host and last host all equal to the address itself.

Checking a Hand-Worked Answer

The calculator is a quick way to check work you did on paper. Take 172.16.45.200/20. A /20 ends in the third octet, where the mask is 240, so the block size is 256 − 240 = 16. Subnets in the third octet start at 0, 16, 32, 48 and so on up to 240, and 45 falls in the block that starts at 32. That makes the network 172.16.32.0 and the broadcast 172.16.47.255, because the next block starts at 48 and every octet after the third is all host bits. Enter 172.16.45.200/20 above and the results match, with 4,094 usable hosts. If your paper answer differs, compare your work with the binary view to see where the prefix line falls. If converting the octets themselves is the sticking point, the binary converter shows the place values for any number.

Splitting a Network

The split section divides the subnet into smaller ones, either into a number of subnets or by a new, longer prefix. Asking for 6 subnets of a /24 rounds up to 8, because borrowing 3 bits gives 2 × 2 × 2 = 8 pieces, each a /27 with 30 usable hosts. The list shows up to 256 subnets and says how many more exist.

IPv4 subnetting is a listed objective on the CompTIA Network+ and Cisco CCNA exams, and network administrators use it when they plan address space.

CIDR Cheat Sheet: /8 to /32

Every prefix from /8 to /32, with its mask, wildcard, size and the block size in the octet where it ends. Generated from the same subnet engine as the calculator. At /8, /16 and /24 the prefix ends on an octet boundary, so the block size is 1 in that octet (256 in the next).

PrefixSubnet maskWildcardAddressesUsable hostsBlock size
/8255.0.0.00.255.255.25516,777,21616,777,2141 (octet 1)
/9255.128.0.00.127.255.2558,388,6088,388,606128 (octet 2)
/10255.192.0.00.63.255.2554,194,3044,194,30264 (octet 2)
/11255.224.0.00.31.255.2552,097,1522,097,15032 (octet 2)
/12255.240.0.00.15.255.2551,048,5761,048,57416 (octet 2)
/13255.248.0.00.7.255.255524,288524,2868 (octet 2)
/14255.252.0.00.3.255.255262,144262,1424 (octet 2)
/15255.254.0.00.1.255.255131,072131,0702 (octet 2)
/16255.255.0.00.0.255.25565,53665,5341 (octet 2)
/17255.255.128.00.0.127.25532,76832,766128 (octet 3)
/18255.255.192.00.0.63.25516,38416,38264 (octet 3)
/19255.255.224.00.0.31.2558,1928,19032 (octet 3)
/20255.255.240.00.0.15.2554,0964,09416 (octet 3)
/21255.255.248.00.0.7.2552,0482,0468 (octet 3)
/22255.255.252.00.0.3.2551,0241,0224 (octet 3)
/23255.255.254.00.0.1.2555125102 (octet 3)
/24255.255.255.00.0.0.2552562541 (octet 3)
/25255.255.255.1280.0.0.127128126128 (octet 4)
/26255.255.255.1920.0.0.63646264 (octet 4)
/27255.255.255.2240.0.0.31323032 (octet 4)
/28255.255.255.2400.0.0.15161416 (octet 4)
/29255.255.255.2480.0.0.7868 (octet 4)
/30255.255.255.2520.0.0.3424 (octet 4)
/31255.255.255.2540.0.0.122 (RFC 3021)2 (octet 4)
/32255.255.255.2550.0.0.0111 (octet 4)

Subnet Calculator FAQ

How do I find the network address from an IP and a subnet mask?

AND the address with the mask, bit by bit: every host bit becomes 0, and what remains is the network address. For 192.168.10.37 with 255.255.255.224, that gives 192.168.10.32. The calculator shows this as the binary view, with the network bits marked.

What is a wildcard mask?

A wildcard mask is the subnet mask with every bit flipped, so each octet is 255 minus the mask octet. A /27 mask of 255.255.255.224 has a wildcard of 0.0.0.31. Cisco access control lists and OSPF network statements use wildcard masks.

Is this the same as an IP address calculator or a CIDR calculator?

Yes. Those names describe the same job: take an IPv4 address and a prefix or mask and work out its network, broadcast and host range. As a CIDR calculator it also shows how many addresses each prefix holds, and the split section turns one CIDR block into smaller ones.

Can I enter a subnet mask instead of a prefix?

Yes. Type 192.168.10.37/27, 192.168.10.37/255.255.255.224 or 192.168.10.37 255.255.255.224, or put the mask in the second field. A mask whose 1 bits aren't contiguous from the left, such as 255.0.255.0, is rejected with an explanation.

Does the calculator save what I type?

No. The math runs in your browser and nothing you type is saved. When you press Calculate or leave the field, your input is added to the page address so you can bookmark or share the result, and like any page address it can appear in the site's analytics, as the privacy policy describes.

Keep researching

Sources

  1. RFC 1918, Address Allocation for Private Internets
  2. RFC 3021, Using 31-Bit Prefixes on IPv4 Point-to-Point Links
  3. RFC 4632, Classless Inter-domain Routing (CIDR)
  4. RFC 1122, Requirements for Internet Hosts
  5. RFC 3927, Dynamic Configuration of IPv4 Link-Local Addresses
  6. RFC 5737, IPv4 Address Blocks Reserved for Documentation
  7. RFC 6598, IANA-Reserved IPv4 Prefix for Shared Address Space
  8. RFC 5771, IANA Guidelines for IPv4 Multicast Address Assignments

Sponsored

Online IT & Cybersecurity Programs

Schools pay to appear in these listings. They are separate from our rankings, which no school can pay to change.