KickSolve/Developer tools/Subnet Calculator
Free · IPv4 · Nothing is uploaded

Subnet calculator.
CIDR, masks, ranges.

Enter an IP address and prefix to get the network, broadcast, host range and masks. Then split it into smaller subnets.

IP address and prefix
Accepts 10.0.0.5/16, 10.0.0.5 255.255.0.0 or a plain address plus the prefix menu.
Enter an IPv4 address to see results.

How to use the subnet calculator

Three steps, no account.

Enter an address

Type an IP with a CIDR prefix or netmask, or pick a prefix from the menu.

Read the details

Click any value to copy it. Network bits are colored in the binary view.

Split if needed

Divide the network into equal smaller subnets and copy the ranges.

What this subnet calculator can do

Everything you need to plan and check an IPv4 network in one place.

Full subnet details

Network, broadcast, first and last usable host, and the number of usable and total addresses.

Masks in every form

Netmask, wildcard mask, integer and hex, ready to paste into a router, firewall or ACL.

Binary view

See exactly which bits belong to the network and which to hosts, in color.

Subnet divider

Split any block into equal smaller subnets and copy the whole list in one click.

Host-count helper

Enter how many devices you need and get the smallest prefix that fits.

Private by design

The maths runs in your browser. Nothing you enter is sent anywhere.

How subnetting works

An IPv4 address has 32 bits. The prefix length (the number after the slash) says how many leading bits identify the network. The rest identify hosts. A /24 leaves 8 host bits, so the subnet holds 28 = 256 addresses.

ValueHow it is found
Network addressIP AND netmask. The first address in the subnet.
Broadcast addressNetwork OR wildcard. The last address in the subnet.
Usable hosts2(32 − prefix) − 2. A /31 has 2 and a /32 has 1.
Wildcard maskThe inverse of the netmask, used in router and firewall rules.
Private ranges: 10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16 are for internal networks and are not routed on the public internet.

What is a subnet?

A subnet is a smaller network carved out of a larger IP address block. Splitting a network this way keeps broadcast traffic contained, makes it easier to apply security rules between groups of devices, and lets you hand out addresses in an organised way instead of one flat pool.

For example, an office might give staff laptops, printers, guest Wi-Fi and servers their own subnets. A firewall can then allow printers to talk to laptops while keeping guests away from servers. The subnet calculator above shows how much room each of those networks has.

CIDR notation and netmasks

CIDR (Classless Inter-Domain Routing) notation writes an address and its network size together, as in 192.168.1.0/24. The number after the slash is the prefix length: how many of the 32 bits are fixed as the network portion. The remaining bits are free to number hosts.

The same information can be written as a netmask, a 32-bit value with ones for the network bits and zeros for the host bits. A /26 is 26 ones followed by six zeros:

/26  =  11111111.11111111.11111111.11000000
     =  255.255.255.192

Because the ones must be contiguous, only 33 masks are valid, from /0 to /32. Each step of one in the prefix halves the number of addresses.

How to calculate a subnet by hand

It helps to know the method even when you use a calculator, for example in an exam or when checking a configuration. Take 192.168.10.77/26:

  1. Find the mask. /26 gives 255.255.255.192. The interesting octet is the last one, 192.
  2. Find the block size. 256 − 192 = 64. Subnets in this range start at multiples of 64: 0, 64, 128 and 192.
  3. Find the network address. 77 falls between 64 and 127, so the network address is 192.168.10.64.
  4. Find the broadcast address. It is one less than the next block: 192.168.10.127.
  5. Find the host range. The first usable host is .65 and the last is .126, so there are 62 usable hosts.

The wildcard mask is simply the inverse of the netmask. Here it is 0.0.0.63.

Subnet mask cheat sheet

This table lists every prefix from /8 to /32 with its netmask, wildcard mask and host counts. Usable hosts are the total minus the network and broadcast addresses, except for /31 and /32.

CIDRNetmaskWildcardTotal addressesUsable hosts
/8255.0.0.00.255.255.25516,777,21616,777,214
/9255.128.0.00.127.255.2558,388,6088,388,606
/10255.192.0.00.63.255.2554,194,3044,194,302
/11255.224.0.00.31.255.2552,097,1522,097,150
/12255.240.0.00.15.255.2551,048,5761,048,574
/13255.248.0.00.7.255.255524,288524,286
/14255.252.0.00.3.255.255262,144262,142
/15255.254.0.00.1.255.255131,072131,070
/16255.255.0.00.0.255.25565,53665,534
/17255.255.128.00.0.127.25532,76832,766
/18255.255.192.00.0.63.25516,38416,382
/19255.255.224.00.0.31.2558,1928,190
/20255.255.240.00.0.15.2554,0964,094
/21255.255.248.00.0.7.2552,0482,046
/22255.255.252.00.0.3.2551,0241,022
/23255.255.254.00.0.1.255512510
/24255.255.255.00.0.0.255256254
/25255.255.255.1280.0.0.127128126
/26255.255.255.1920.0.0.636462
/27255.255.255.2240.0.0.313230
/28255.255.255.2400.0.0.151614
/29255.255.255.2480.0.0.786
/30255.255.255.2520.0.0.342
/31255.255.255.2540.0.0.122
/32255.255.255.2550.0.0.011

Splitting a network and VLSM

To split a network into equal parts, increase the prefix length. Each extra bit doubles the number of subnets and halves their size. Splitting 192.168.1.0/24 into four gives four /26 subnets:

SubnetUsable rangeBroadcast
192.168.1.0/26192.168.1.1 to 192.168.1.62192.168.1.63
192.168.1.64/26192.168.1.65 to 192.168.1.126192.168.1.127
192.168.1.128/26192.168.1.129 to 192.168.1.190192.168.1.191
192.168.1.192/26192.168.1.193 to 192.168.1.254192.168.1.255

Equal splits are simple but can waste addresses. With Variable Length Subnet Masking (VLSM) you size each subnet to what it needs. A good rule is to allocate the largest requirement first so every block stays aligned. Here is one plan for a single /24:

NetworkHosts neededPrefixSubnetUsable range
Sales100/25 (126 hosts)192.168.1.0/25.1 to .126
Engineering50/26 (62 hosts)192.168.1.128/26.129 to .190
Guest Wi-Fi20/27 (30 hosts)192.168.1.192/27.193 to .222
Router link2/30 (2 hosts)192.168.1.224/30.225 to .226

The remaining space, 192.168.1.228 to 192.168.1.255, is still free for future subnets.

Combining networks: the reverse of splitting is route summarization, or supernetting. Two adjacent, aligned blocks such as 192.168.0.0/24 and 192.168.1.0/24 can be advertised as one 192.168.0.0/23.

Private and special IPv4 ranges

Not every IPv4 address is available on the public internet. These ranges have a defined purpose, and the calculator labels them in the Address type field.

RangePurposeNotes
10.0.0.0/8Private (RFC 1918)16,777,216 addresses. Large internal networks.
172.16.0.0/12Private (RFC 1918)1,048,576 addresses, from 172.16.0.0 to 172.31.255.255.
192.168.0.0/16Private (RFC 1918)65,536 addresses. Typical for home and small office routers.
100.64.0.0/10Shared address space (RFC 6598)Used by ISPs for carrier-grade NAT.
127.0.0.0/8Loopback127.0.0.1 is localhost, the device talking to itself.
169.254.0.0/16Link-localSelf-assigned when DHCP is unavailable.
192.0.2.0/24, 198.51.100.0/24, 203.0.113.0/24DocumentationSafe to use in examples and tutorials.
224.0.0.0/4MulticastTraffic sent to a group of receivers.
240.0.0.0/4ReservedNot for normal use. 255.255.255.255 is the limited broadcast address.

IP address classes

Early IPv4 grouped addresses into classes by their first octet. Classful addressing has been replaced by CIDR, but the terms still appear in textbooks, certification exams and some device menus, so the calculator reports the class for reference.

ClassFirst octetHistoric default maskTypical use
A1 to 126/8 (255.0.0.0)Very large networks
B128 to 191/16 (255.255.0.0)Medium networks
C192 to 223/24 (255.255.255.0)Small networks
D224 to 239n/aMulticast
E240 to 255n/aReserved

Where subnetting is used

  • Home and office networks. Separate VLANs for staff, guests, cameras and servers.
  • Cloud networks. Planning VPC and virtual network address space, then dividing it into public and private subnets across zones.
  • Firewall and router rules. Access lists and routing tables refer to networks as address and mask pairs.
  • Point-to-point links. A /30 or /31 connects two routers without wasting addresses.
  • Study and certification. Subnetting is a core skill for CCNA, Network+ and similar exams, and a calculator is handy for checking your answers.

Common mistakes

  • Assigning the network or broadcast address to a host. On a normal subnet the first and last addresses are reserved.
  • Overlapping subnets. Two subnets that share addresses cause routing problems. Check ranges before you assign them.
  • Mixing up netmask and wildcard. Cisco ACLs use the wildcard, so a /24 is written 0.0.0.255, not 255.255.255.0.
  • Sizing for today only. Leave room to grow, because renumbering a network later is painful.
  • Entering an invalid mask. Masks must be contiguous ones followed by zeros. 255.255.0.255 is not valid.

Key terms

Network address
The first address in a subnet. It identifies the network itself and is not assigned to a host.
Broadcast address
The last address in a subnet. A packet sent to it reaches every host in that subnet.
Netmask (subnet mask)
A 32-bit value that separates the network portion of an address from the host portion.
Wildcard mask
The bitwise inverse of the netmask, used in router and firewall rules.
Prefix length
The number of network bits, written after a slash in CIDR notation.
VLSM
Using different prefix lengths within one address block to fit each subnet to its needs.
Usable host range
The addresses between the network and broadcast addresses that can be assigned to devices.

FAQs

What is a subnet calculator?

It takes an IP address and a prefix length or netmask and works out the network address, broadcast address, usable host range, number of hosts, wildcard mask and more.

What does CIDR notation like /24 mean?

The number after the slash is how many leading bits belong to the network. A /24 means 24 network bits and 8 host bits, which is the netmask 255.255.255.0 and 256 addresses.

Why are two addresses not usable?

The first address in a subnet is the network address and the last is the broadcast address, so usable hosts are total addresses minus 2. A /31 point-to-point link and a /32 single host are special cases.

What is a wildcard mask?

It is the inverse of the netmask. Routers and firewalls such as Cisco ACLs use it, where 0 bits must match and 1 bits are ignored. For 255.255.255.0 the wildcard is 0.0.0.255.

Does it support IPv6?

Not yet. This calculator handles IPv4 only.

Is my data sent to a server?

No. All calculations run in your browser and nothing is uploaded.

What is the difference between a subnet mask and a CIDR prefix?

They describe the same thing in two formats. 255.255.255.0 and /24 both mean that the first 24 bits are the network portion. CIDR is shorter to write, while the dotted mask is still common in operating system settings and older documentation.

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

Convert both to binary and apply a bitwise AND. For 192.168.10.77 with mask 255.255.255.192 (/26), the result is 192.168.10.64. The calculator does this for you and highlights the network and host bits in the binary view.

How many usable hosts are in a /24, /26 or /30?

A /24 has 254 usable hosts, a /26 has 62 and a /30 has 2. The formula is 2 to the power of (32 minus the prefix) minus 2.

Can I use the first and last address in a subnet?

On a normal subnet, no: they are the network and broadcast addresses. A /31 (RFC 3021) uses both addresses on a point-to-point link, and a /32 identifies a single host. Cloud providers can reserve extra addresses, so check their documentation. AWS, for example, reserves five addresses in every VPC subnet.

What is VLSM?

Variable Length Subnet Masking means using different prefix lengths inside one address block, so each subnet is sized to its real need instead of being the same size. It wastes fewer addresses than splitting everything equally.

How do I choose the right subnet size?

Count the hosts you need today, add room to grow, then pick the smallest prefix that fits. The Hosts needed box on this page does the lookup. For example, 50 devices need a /26, which gives 62 usable addresses.

Which IP ranges are private?

The private ranges from RFC 1918 are 10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16. They are meant for internal networks and are not routed on the public internet.

Can I combine several subnets into one larger network?

Yes, if they are contiguous and aligned on the right boundary. This is called supernetting or route summarization. For example, 192.168.0.0/24 and 192.168.1.0/24 combine into 192.168.0.0/23.

Need a tool we don't have yet?

Tell us what you need and we will add it to the list.

Contact us