Subnet Calculator

Type an IP address with a CIDR prefix or subnet mask to get its network, broadcast address, usable host range and wildcard mask.

IPv4 address

With /24 or a mask such as 255.255.255.0 after it, or pick the mask below.

Subnet mask
Try
?usable hosts

Type an IPv4 address to see its subnet.

Subnet

Network address
Not yet
Broadcast address
Not yet
First usable host
Not yet
Last usable host
Not yet
Usable hosts
Not yet
Subnet mask
Not yet
Wildcard mask
Not yet

In binary

The address and mask show here bit by bit once the address reads.

Hosts needed

Type how many devices the subnet must hold to pick the smallest mask with room.

Is this address in the subnet?

Type any address, such as 192.168.1.77.

Split into subnets

Type an address above to list its subnets.

Split into

Subnet mask cheat sheet

Every IPv4 prefix from /32 to /0 with its mask, wildcard, addresses and hosts. Press one to use it above.

IPv4 subnet masks from /32 to /0
CIDRSubnet maskWildcard maskAddressesUsable hosts
255.255.255.2550.0.0.011
255.255.255.2540.0.0.122 (RFC 3021)
255.255.255.2520.0.0.342
255.255.255.2480.0.0.786
255.255.255.2400.0.0.151614
255.255.255.2240.0.0.313230
255.255.255.1920.0.0.636462
255.255.255.1280.0.0.127128126
255.255.255.00.0.0.255256254
255.255.254.00.0.1.255512510
255.255.252.00.0.3.2551,0241,022
255.255.248.00.0.7.2552,0482,046
255.255.240.00.0.15.2554,0964,094
255.255.224.00.0.31.2558,1928,190
255.255.192.00.0.63.25516,38416,382
255.255.128.00.0.127.25532,76832,766
255.255.0.00.0.255.25565,53665,534
255.254.0.00.1.255.255131,072131,070
255.252.0.00.3.255.255262,144262,142
255.248.0.00.7.255.255524,288524,286
255.240.0.00.15.255.2551,048,5761,048,574
255.224.0.00.31.255.2552,097,1522,097,150
255.192.0.00.63.255.2554,194,3044,194,302
255.128.0.00.127.255.2558,388,6088,388,606
255.0.0.00.255.255.25516,777,21616,777,214
254.0.0.01.255.255.25533,554,43233,554,430
252.0.0.03.255.255.25567,108,86467,108,862
248.0.0.07.255.255.255134,217,728134,217,726
240.0.0.015.255.255.255268,435,456268,435,454
224.0.0.031.255.255.255536,870,912536,870,910
192.0.0.063.255.255.2551,073,741,8241,073,741,822
128.0.0.0127.255.255.2552,147,483,6482,147,483,646
0.0.0.0255.255.255.2554,294,967,2964,294,967,294

Made for subnetting practice, CCNA labs and real networks: every answer shows the mask and the address in binary, so the method is easy to check.

Every subnet, VLSM plan and IPv6 prefix is worked out in this tab with exact maths, and no address you type is sent to a server.

  • IPv4 and IPv6
  • VLSM from host counts
  • Every mask in binary

How to calculate a subnet

Type an address and mask, read the host range, then split the network into smaller subnets.

  1. Type the IP and mask

    Type an address such as 192.168.1.10/24, or pick a mask from the subnet mask list. 255.255.255.0 works there too.

  2. Read the host range

    The network, broadcast and usable IP range show at once, each ready to copy: 192.168.1.1 to 192.168.1.254 for a /24.

  3. Split into subnets

    Pick a smaller size under Split into subnets to list every block: a /24 holds four /26 subnets of 62 hosts each.

How to find the network and broadcast address

A subnet mask splits an IPv4 address in two: network bits on the left, host bits on the right. To find the network address, keep the network bits and set every host bit to 0. That is a bitwise AND of the address and the mask, one octet at a time.

Take 172.16.5.4/20. Its mask is 255.255.240.0, so the cut falls in the third octet: 5 AND 240 is 0, which gives the network 172.16.0.0. The broadcast address sets every host bit to 1 instead, giving 172.16.15.255. The usable hosts run from 172.16.0.1 to 172.16.15.254.

A quick check by hand: 256 minus the mask's cut octet is the block size. For 240 that is 16, so /20 networks start at 0, 16, 32 and so on in the third octet. The In binary view in the calculator draws the line between network and host bits for you.

CIDR notation and subnet masks

CIDR notation writes the mask as a slash and the number of network bits. /24 means the first 24 bits are the network, which is 255.255.255.0 written out. Each step from /24 to /25 and on halves the block: 256 addresses, then 128, then 64.

To turn CIDR into a subnet mask, write that many 1s, fill the rest of the 32 bits with 0s and read each group of eight as a number. /26 is 11111111.11111111.11111111.11000000, or 255.255.255.192. To go back, count the 1s.

A block holds 2 to the power of its host bits: a /29 has 3, so 8 addresses. The network and broadcast addresses take two, leaving 6 hosts, and a /30 mask leaves 2. A /31 is the exception: both its addresses work on a point to point link (RFC 3021).

Variable length subnet mask (VLSM)

Splitting a network into equal subnets wastes space when groups differ in size. A variable length subnet mask gives each group a block that fits it: a /26 for 50 office machines, a /28 for 12 printers and a /30 for the link to the router.

The VLSM tab builds the plan from host counts. List each subnet with the hosts it needs; the calculator sorts them largest first and places each on the next free boundary, so no blocks overlap and the free space stays in one piece.

For 192.168.10.0/24 with 50, 12 and 2 hosts, the subnets are 192.168.10.0/26, 192.168.10.64/28 and 192.168.10.80/30. Together they use 84 of the 256 addresses, and the plan lists what is left after them as four free CIDR blocks.

IPv6 subnetting

An IPv6 address is 128 bits, written as eight groups of four hex digits. Subnetting works as it does in IPv4, only with far bigger numbers: the prefix length counts the network bits, and every bit after it belongs to the interface.

Almost every IPv6 LAN is a /64, because SLAAC, the way devices give themselves an address, needs 64 interface bits. A site is often given a /48, which holds 65,536 /64 subnets, and a home connection usually gets a /56 or a /60.

IPv6 has no broadcast address, so every address in a block counts. The IPv6 tab writes each address in full and in its short form, with leading zeros dropped and the longest run of zero groups written as ::, as RFC 5952 asks.

IP calculator with VLSM and ranges

  • Subnet splitter

    Split any network into equal smaller subnets and list every one, copied for Excel or as a CSV.

  • VLSM calculator

    List the hosts each subnet needs and get blocks sized to fit, placed largest first with no overlaps.

  • IPv6 subnet calculator

    Expand or shorten IPv6 addresses, read a prefix's first and last address and count its /64 networks.

  • Wildcard mask

    The wildcard mask sits beside the subnet mask, 0.0.0.255 for a /24, ready for Cisco ACLs and OSPF.

  • IP range to CIDR

    Type the first and last address of a range to get the fewest CIDR blocks that cover it exactly.

  • IP address to binary

    See the address, mask, network and broadcast in binary, network bits set apart from host bits.

A free subnet calculator, nothing sent

Every subnet is worked out in this browser tab, so the addresses of your network stay on your device.

  • Processing

    Addresses and masks are worked out by code running in this tab. No IP you type is sent or logged.

  • Storage

    No address is kept. Reload the tab and every address box, subnet list and VLSM plan is empty again.

  • Account

    No account, no email and no daily limit: plan one subnet or a whole campus network of them for free.

Subnetting questions

What is a subnet mask?

A 32-bit number that marks which part of an IPv4 address is the network and which part is the host. 255.255.255.0 keeps 24 bits.

What is a subnet in networking?

A smaller network carved out of a bigger one. Devices in one subnet talk directly; traffic to others goes through a router.

What is the subnet mask for /24?

255.255.255.0. A /24 holds 256 addresses, 254 of them usable hosts, the most common size for a home or office network.

How many IP addresses are in a /16?

65,536, of which 65,534 are usable hosts. Its subnet mask is 255.255.0.0, and it holds 256 networks of /24 each.

What is a broadcast address?

The last address of a subnet, with every host bit set to 1. A packet sent to it reaches every device there, so no host can use it.

What are the private IP ranges?

10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16, set aside by RFC 1918. Use them inside any network; they are never routed online.

What is a default gateway?

The router address devices send traffic to when it leaves their subnet. It sits inside the subnet, often its first usable host.

What does CIDR mean?

Classless Inter-Domain Routing: a network written as an address and a prefix length, like 10.0.0.0/8, in place of the old classes.

Still stuck, or found a problem? Email dobliquestudio@gmail.com and we will help.