Subnet Calculator

Enter any IPv4 or IPv6 address with a prefix or mask to get its network, host range, masks, address type and reverse DNS zone, then split it, plan VLSM subnets or summarize routes.

Runs entirely in your browser. Nothing you add is sent to us.

Create a free account to use the Subnet Calculator

Free forever for this tool. Takes a few seconds — then you come straight back here.

  • All 150 free tools, one login
  • Free website audit with fixes
  • Search Console dashboard
  • Free keyword rank tracker

Already have an account? Sign in

Subnet Calculator — subnet calculator

A subnet calculator turns an address like 192.168.1.10/24 into everything you need to configure a network: the network and broadcast addresses, the first and last usable host, how many hosts fit, the subnet and wildcard masks, and the reverse DNS zone. This one handles IPv4 and IPv6 in the same box, works with prefix lengths or dotted masks, and tells you whether an address is private, public, carrier-grade NAT, link-local, multicast or reserved for documentation. Further tabs split a network into equal subnets, plan VLSM subnets from host counts, summarize a list of CIDR blocks into the fewest routes, and check whether an IP falls inside a set of ranges. Tables export to CSV, and every calculation runs in your browser.

How to use the Subnet calculator

  1. 1 Enter an address and prefixType an IPv4 or IPv6 address with its prefix, such as 10.0.4.17/22 or 2001:db8:abcd::/48. For IPv4 you can also give a dotted mask after a space or in the Mask box, for example 172.16.5.4 255.255.240.0.
  2. 2 Read the network detailsThe results show the network address, usable host range, broadcast address, host counts, masks, the address type with its RFC, and the reverse DNS zone. IPv6 results add the expanded and RFC 5952 compressed forms.
  3. 3 Split the networkOpen Split a network and choose a number of subnets, a number of hosts per subnet or a new prefix length. The table lists every subnet, and you can copy or download it as CSV.
  4. 4 Plan VLSM subnetsIn the VLSM tab, list each subnet you need with its host count, one per line, such as "Sales 60". The calculator places the largest first, shows the spare addresses in each, and lists the free space left over.
  5. 5 Summarize or check rangesPaste a list of networks into Summarize to get the shortest exact list and a single covering supernet, or use Is this IP in range? to test one address against an allowlist or firewall rules.

What CIDR notation and prefix lengths mean

Every IP address has two parts: a network part shared by every device on the same subnet, and a host part that identifies one device. CIDR notation, short for Classless Inter-Domain Routing, writes the size of the network part after a slash. In 192.168.1.10/24 the first 24 of the 32 bits are the network, leaving 8 bits, or 256 addresses, for hosts. IPv6 works the same way with 128 bits, so 2001:db8:abcd:12::/64 leaves 64 bits for hosts.

The subnet mask is the same information written as an address. A /24 is 255.255.255.0, a /22 is 255.255.252.0 and a /30 is 255.255.255.252. A valid mask is always a run of 1 bits followed by a run of 0 bits, which is why 255.255.255.0 is fine but 255.0.255.0 is not. The binary view in the calculator shows the network bits and host bits side by side so you can see exactly where the boundary falls, even when it sits in the middle of an octet.

The wildcard mask is the inverse of the subnet mask: 0.0.0.255 for a /24. Cisco access control lists and OSPF network statements use wildcard masks, so the calculator shows both, and it warns you if you paste a wildcard mask where a subnet mask was expected.

Network, broadcast and usable host addresses

In a normal IPv4 subnet, two addresses are reserved. The lowest, with every host bit set to 0, is the network address that identifies the subnet in routing tables. The highest, with every host bit set to 1, is the broadcast address that reaches every device on the subnet. Everything in between can be assigned to hosts, so a /24 has 256 addresses and 254 usable hosts, and a /26 has 64 addresses and 62 usable hosts. Your router or gateway also takes one of the usable addresses, so plan for that when you count devices.

Two prefix lengths are special. A /31 has only two addresses. RFC 3021 lets both be used on point-to-point links between routers, with no network or broadcast address, which saves addresses on every link. Most modern router and firewall software supports this, but check yours before relying on it. A /32 is a single address, used for loopback interfaces, host routes and firewall rules that target one machine. The calculator reports both cases correctly instead of showing negative or zero host counts.

IPv6 has no broadcast address at all; multicast does that job. Every address in an IPv6 subnet can be assigned, although the all-zeros address in each subnet is defined as the Subnet-Router anycast address. Ordinary LANs use /64 subnets, because stateless address autoconfiguration (SLAAC) needs a 64-bit interface ID, and RFC 6164 recommends /127 for links between routers.

Private, public and special-purpose ranges

Not every address is meant to appear on the public internet. The calculator checks the address and the whole network against the IANA special-purpose registries and labels the result with the RFC that defines it. The most common ranges are listed below. If a network straddles several ranges, as 0.0.0.0/0 or 172.16.0.0/11 do, it is labeled as mixed and the special ranges inside it are listed.

  • Private (RFC 1918): 10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16, used inside homes and organizations behind NAT.
  • Shared address space (RFC 6598): 100.64.0.0/10, used by internet providers for carrier-grade NAT. If your router's WAN address starts with 100.64 to 100.127, your connection is behind CGNAT and inbound port forwarding will not work without help from the provider.
  • Loopback and link-local: 127.0.0.0/8 and ::1 point back to the same machine; 169.254.0.0/16 and fe80::/10 are self-assigned addresses that only work on the local link. A device with a 169.254 address usually failed to reach a DHCP server.
  • Documentation (RFC 5737 and RFC 3849): 192.0.2.0/24, 198.51.100.0/24, 203.0.113.0/24, 2001:db8::/32 and 3fff::/20 (RFC 9637) are reserved for examples, so they are safe to use in manuals and tutorials.
  • Multicast: 224.0.0.0/4 for IPv4 and ff00::/8 for IPv6. For IPv6 multicast the calculator also shows the scope, such as link-local or global.
  • IPv6 unique local addresses (RFC 4193): fc00::/7, in practice fd00::/8 with a random 40-bit global ID, are the IPv6 counterpart of private addresses.

Splitting a network and VLSM planning

Subnetting means borrowing host bits to create several smaller networks. Each extra bit doubles the number of subnets and halves their size, so a /24 splits into two /25s, four /26s or eight /27s. Because the split always goes in powers of two, asking for five subnets gives you eight, and the table shows every one with its range and broadcast address. Splitting by hosts works the other way round: you give the number of devices each subnet must hold, and the calculator picks the smallest prefix that fits, keeping room for the network and broadcast addresses.

Equal subnets waste space when needs differ. A sales floor with 60 people and a router link with 2 addresses do not both need a /26. Variable Length Subnet Masking, or VLSM, gives each group a subnet sized to its needs. The VLSM tab sorts your requests from largest to smallest and places them one after another, which keeps every subnet on a correct boundary. It shows the spare addresses in each subnet and the free blocks left for later, and it tells you how large a network you need if the requests do not fit. Leave some headroom: a subnet that is exactly full today will be too small next year.

Route summarization and supernets

Summarization works in the opposite direction. It merges neighboring networks into fewer, larger blocks, which keeps routing tables, firewall rules and cloud security groups short. 192.168.0.0/24 and 192.168.1.0/24 combine exactly into 192.168.0.0/23. The Summarize tab merges overlapping and adjacent entries and returns the shortest list of CIDR blocks that covers exactly the same addresses, so nothing is added or lost. You can paste single addresses and ranges written as start - end as well as CIDR blocks, and IPv4 and IPv6 are handled separately.

It also shows the single supernet that contains everything, along with how many extra addresses that supernet includes. 10.0.0.0/24 and 10.0.2.0/24 fit in 10.0.0.0/22, but so do 512 addresses you never listed. Before using a supernet in a route or an allow rule, make sure those extra addresses are yours, or you may send traffic to the wrong place or let in more than you meant to.

IPv6 notation, compression and reverse DNS

An IPv6 address is eight groups of four hex digits, which is long to type. RFC 5952 sets one canonical short form: lower-case letters, no leading zeros in a group, and the longest run of two or more all-zero groups replaced by a double colon. When two runs tie, the first is shortened, and a single zero group is never replaced. So 2001:0db8:0000:0000:0001:0000:0000:0001 becomes 2001:db8::1:0:0:1. Comparing addresses in their canonical form avoids false mismatches in logs, allowlists and configuration files. The calculator shows both the compressed and fully expanded forms, accepts an embedded IPv4 tail such as ::ffff:192.0.2.1, and ignores a zone ID like %eth0.

Reverse DNS maps an address back to a name using PTR records. IPv4 reverse zones live under in-addr.arpa on octet boundaries, and IPv6 zones live under ip6.arpa on 4-bit nibble boundaries. A network that does not sit on a boundary, such as a /22 or a /62, is covered by several zones, and the calculator lists them. Networks smaller than a /24 do not get their own IPv4 reverse zone. The provider either adds PTR records for you or delegates them using RFC 2317 classless delegation. Mail servers in particular need a PTR record that matches their hostname.

Address classes, and what this calculator does not do

IPv4 addresses were once divided into classes A, B and C with fixed masks of /8, /16 and /24, plus class D for multicast and class E for experiments. CIDR replaced that system in 1993, and routers today ignore classes completely. The calculator still shows the historic class because certification exams and older documentation refer to it, and labels it as historic.

All calculations follow the published standards and run in your browser, so the addresses you enter are not sent to our server. The tool does not look up who owns an address, where it is located or whether it is in use; use a WHOIS or IP lookup tool for that. Tables are limited to the first 4,096 subnets so that very large splits, such as a /32 IPv6 allocation divided into /64s, do not freeze the page. The total is still calculated exactly.

Examples you can copy

A typical office LAN

Input:      192.168.1.10/24
Network:    192.168.1.0
Usable:     192.168.1.1 - 192.168.1.254  (254 hosts)
Broadcast:  192.168.1.255
Mask:       255.255.255.0   Wildcard: 0.0.0.255
Type:       Private network (RFC 1918)
Reverse:    1.168.192.in-addr.arpa

VLSM plan for a /24

Network: 192.168.10.0/24

Sales 60        -> 192.168.10.0/26    (62 usable)
Engineering 28  -> 192.168.10.64/27   (30 usable)
Guest Wi-Fi 12  -> 192.168.10.96/28   (14 usable)
Router link 2   -> 192.168.10.112/30  (2 usable)

Free: 192.168.10.116/30, 192.168.10.120/29, 192.168.10.128/25

IPv6 compression (RFC 5952)

2001:0DB8:0000:0000:0000:FF00:0042:8329 -> 2001:db8::ff00:42:8329
2001:db8:0:0:1:0:0:1                    -> 2001:db8::1:0:0:1
2001:db8:0:1:1:1:1:1                    -> 2001:db8:0:1:1:1:1:1
0:0:0:0:0:0:0:1                         -> ::1

Summarizing routes

192.168.0.0/24
192.168.1.0/24
192.168.2.0/25
192.168.2.128/25

Exact:     192.168.0.0/23, 192.168.2.0/24
Supernet:  192.168.0.0/22 (also covers 256 unlisted addresses)

Common mistakes to avoid

Counting every address as a usable host

An IPv4 /24 has 256 addresses but only 254 usable hosts, and the gateway takes one of those. Size subnets on usable hosts, not total addresses.

Using a host address as the network

Routes and firewall rules want the network address. 192.168.1.77/24 means the 192.168.1.0/24 network; the calculator shows the correct form.

Mixing up subnet and wildcard masks

Cisco ACLs and OSPF use wildcard masks such as 0.0.0.255, while interfaces use subnet masks such as 255.255.255.0. Swapping them gives very different results.

Summarizing into a supernet that includes addresses you do not own

A covering supernet is often larger than the networks you listed. Check the extra addresses before advertising or allowing it.

Using IPv6 subnets longer than /64 on a LAN

SLAAC needs a 64-bit interface ID, so a /80 or /96 LAN leaves devices without automatic addresses. Use /64 for LANs and /127 for router links.

Copying examples with real addresses

Use the documentation ranges 192.0.2.0/24, 198.51.100.0/24, 203.0.113.0/24 or 2001:db8::/32 in guides, so readers never paste someone else's address into their config.

Frequently asked questions

Subtract the prefix from 32 for IPv4, raise 2 to that power, then take away 2 for the network and broadcast addresses. A /26 has 2^6 = 64 addresses and 62 usable hosts. /31 and /32 are exceptions with 2 and 1.

Yes. Enter an IPv6 address with a prefix, like 2001:db8::/48, to get the expanded and compressed forms, the address range, the exact address count, the address type and the ip6.arpa zone.

They describe the same thing. A prefix length such as /24 counts the network bits, while a subnet mask such as 255.255.255.0 writes those bits as an address. Every valid IPv4 mask matches one prefix from /0 to /32.

RFC 3021 allows /31 subnets on point-to-point links, where no network or broadcast address is needed, so both addresses can be used. On ordinary LANs, use a /30 or larger.

A /48 contains 65,536 /64 subnets, because 64 minus 48 leaves 16 bits for subnets and 2 to the power of 16 is 65,536. A /56 contains 256 of them.

That range is shared address space for carrier-grade NAT (RFC 6598). Your provider is placing you behind its own NAT, so other people cannot reach your devices directly and port forwarding on your own router will not work on its own.

Yes, in the Summarize and range-check tabs. The summarizer turns a range into the smallest set of CIDR blocks that covers it exactly, which helps when a firewall only accepts CIDR notation.

No. Classful addressing was replaced by CIDR in 1993, and routing ignores it. The class is shown for exams and older documentation, and is labeled as historic.

Free website audit

See how your site scores, free

Speed, SEO, DNS, email (SPF/DKIM/DMARC) and security in one scan, with a prioritised fix list.