Skip to content
DeviceCheckHub

Subnet Calculator

Type an IP address with its prefix or subnet mask to get the network and broadcast address, the usable host range, the wildcard mask and the address type, for IPv4 and IPv6. Split a network into subnets, plan VLSM from host counts, or turn an address range into CIDR blocks. It is an IP calculator that runs in your browser.

192.168.1.10 is in 192.168.1.0/24: 254 usable hosts.

Results

Address192.168.1.10
Network192.168.1.0/24
Subnet mask255.255.255.0 (/24)
Wildcard mask0.0.0.255
Broadcast address192.168.1.255
Usable host range192.168.1.1 – 192.168.1.254
Usable hosts254
Total addresses256 (2^8)
Address typePrivate network (RFC 1918, 192.168.0.0/16)
Class (before CIDR)Class C
Binary address11000000.10101000.00000001.00001010
Integer and hex3232235786 · 0xC0A8010A
Reverse DNS zone1.168.192.in-addr.arpa
IPv4-mapped IPv6::ffff:192.168.1.10

Network bits · host bits in the binary address

Is an address inside this network?

Type another address to see whether it is inside this network.

Split into subnets

#SubnetUsable rangeHosts
Pick a size above to split this network.

Working out the plan…
SubnetNeedsNetworkMaskUsable rangeBroadcastUsableSpare

Type the first and last address of the range.
CIDR blockAddresses from – toCount

How to use the subnet calculator

  1. Type an IPv4 address with a prefix such as 192.168.1.10/24, or with a subnet mask such as 192.168.1.10 255.255.255.0. You can also type the address alone and pick the prefix from the list. IPv6 works the same way: 2001:db8::1/64.
  2. Read the results: the network address, subnet mask and wildcard mask, the broadcast address, the first and last usable host, how many hosts fit, the address type (private, public, loopback and so on) and the reverse DNS zone.
  3. Check whether another address belongs to the network, or split the network into smaller subnets and download the list in a CSV file.
  4. Switch to VLSM plan to fit several subnets of different sizes into one network, or to Range to CIDR to turn a first and last address into the fewest CIDR blocks, for a firewall rule or an allow list.

How subnetting works

An IPv4 address is 32 bits, written in four numbers from 0 to 255. The prefix length says how many of those bits, counted from the left, name the network; the rest number the hosts inside it. A /24 keeps 24 network bits and leaves 8 host bits, so it holds 28 = 256 addresses. The subnet mask is the same idea written like an address: 24 ones followed by 8 zeros is 255.255.255.0.

To find the network an address belongs to, the computer does a bitwise AND of the address and the mask, which clears the host bits. Setting every host bit to 1 instead gives the broadcast address, the last one in the subnet. In IPv4 those two addresses are not given to hosts, which is why a /24 has 254 usable hosts and not 256. The calculator shows the address in binary with the network bits and host bits in different colours, so you can see where the line falls.

CIDR (Classless Inter-Domain Routing, RFC 4632) replaced the old class A, B and C networks in 1993, so a prefix can be any length from /0 to /32. The class is still shown because some exams and older equipment refer to it, but it no longer decides the size of a network.

IPv4 subnet mask cheat sheet

Every prefix from /8 to /32, with its mask, wildcard mask, the number of addresses and the usable hosts:

PrefixSubnet maskWildcardAddressesUsable 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

Private, public and special addresses

Some ranges are set aside and never routed on the public internet. The calculator names the range an address falls in, from the IANA special-purpose address registries:

/30, /31 and /32

A link between two routers needs only two addresses. Traditionally it used a /30: four addresses, two of them usable. RFC 3021 allows a /31 on point-to-point links, where the network and broadcast addresses are not needed, so both addresses go to the routers and half the space is saved. A /32 is a single address, used for loopback interfaces and host routes. The calculator follows these rules, so a /31 shows two usable hosts and no broadcast address.

Subnetting IPv6

An IPv6 address is 128 bits, written in eight groups of four hexadecimal digits. The calculator writes it the standard short way (RFC 5952): leading zeros dropped, the longest run of zero groups replaced by ::, and lower case. It also shows the full expanded form. IPv6 has no broadcast address, so every address in a subnet is usable.

Almost every IPv6 LAN is a /64, because address autoconfiguration needs a 64-bit interface identifier. A provider usually gives a site a /48 or a /56, which you then cut into /64s: a /48 holds 65,536 of them and a /56 holds 256. The /64 subnets row shows that number for any prefix shorter than /64. Hexadecimal makes the split easy to read, because each digit is 4 bits: a /52, /56 or /60 boundary always falls on a whole digit.

Planning subnets with VLSM

With fixed-length subnetting every subnet has the same size, so a two-host router link takes the same room that a 60-host office does. VLSM sizes each subnet to fit. The calculator sorts your subnets from largest to smallest and gives each one the smallest block that holds its hosts plus the network and broadcast addresses, one after another from the start of the network. Taking the largest first keeps every block on a boundary of its own size, which routers require, and leaves the free space in one piece at the end.

For example, 192.168.10.0/24 with Sales (60 hosts), Engineering (28), Guest Wi-Fi (12), Printers (5) and a router link (2) becomes a /26, a /27, a /28, a /29 and a /30, using 124 of the 256 addresses and leaving 192.168.10.124/30, 192.168.10.128/25 free for later.

From an address range to CIDR

Firewalls, cloud security groups and allow lists usually take CIDR blocks, not ranges. A range that does not start and end on a block boundary needs several blocks: 192.168.1.10 to 192.168.1.100 is 91 addresses and becomes 192.168.1.10/31, 192.168.1.12/30, 192.168.1.16/28, 192.168.1.32/27, 192.168.1.64/27, 192.168.1.96/30 and 192.168.1.100/32. The calculator finds the fewest blocks that cover the range exactly, for IPv4 or IPv6.

Wildcard masks and reverse DNS

The wildcard mask is the subnet mask inverted. Cisco routers use it in access lists and OSPF network statements, and some firewalls ask for it too. The reverse DNS zone is the name under in-addr.arpa (IPv4) or ip6.arpa (IPv6) where the PTR records for the network live. Zones follow whole octets in IPv4 and whole hex digits in IPv6, so a /22 needs four /24 zones, and a network smaller than a /24 shares its /24 zone through classless delegation (RFC 2317).

Privacy

The calculator works entirely in your browser: addresses are never sent to a server. Your last inputs are saved in your browser’s local storage so they are there next time, and Copy a link puts the address after a # in the link, a part that browsers never send to a server. To find your own public address, use What Is My IP.

Frequently asked questions

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

Write both in binary and keep only the bits where the mask has a 1 (a bitwise AND). For 192.168.1.10 with 255.255.255.0 the last octet is cleared, so the network is 192.168.1.0. Setting all the host bits to 1 instead gives the broadcast address, 192.168.1.255.

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

A subnet of prefix /n has 2 to the power (32 − n) addresses, and two of them are the network and broadcast addresses. So a /24 has 256 addresses and 254 usable hosts, a /27 has 32 and 30, and a /30 has 4 and 2. A /31 is the exception: on a point-to-point link both of its addresses are usable (RFC 3021).

What is a wildcard mask?

The subnet mask with every bit flipped: 255.255.255.0 becomes 0.0.0.255. Cisco access lists and OSPF network statements use it, with 0 meaning “this bit must match” and 1 meaning “any value”. Each octet of the wildcard is 255 minus the same octet of the mask.

What are the private IP address ranges?

RFC 1918 sets aside 10.0.0.0/8, 172.16.0.0/12 (172.16.0.0 to 172.31.255.255) and 192.168.0.0/16 for private networks. They are never routed on the internet, so a router uses NAT to share one public address. 100.64.0.0/10 is a separate shared range that internet providers use for carrier-grade NAT (RFC 6598).

Why is an IPv6 subnet usually a /64?

IPv6 addresses split into a 64-bit network prefix and a 64-bit interface identifier, and stateless address autoconfiguration (SLAAC) only works with a /64. A /64 holds 18,446,744,073,709,551,616 addresses, so the question in IPv6 is how many subnets you need, not how many hosts. A site usually receives a /48 or /56, which is 65,536 or 256 subnets of /64.

What is VLSM?

Variable Length Subnet Masking gives each subnet the smallest block that fits it instead of making every subnet the same size. You list the subnets with their host counts, sort them largest first, and give each one the next free block of the right size: 60 hosts get a /26 (62 usable), 25 hosts a /27 (30 usable), and a point-to-point link a /30.

Does this subnet calculator send my IP addresses anywhere?

No. Every result is worked out by the page in your browser, and nothing you type is sent to a server. Your last inputs are kept only in your own browser, so they are there when you come back.

Last updated · About DeviceCheckHub