- Home
- Free tools
- Subnet calculator
IP subnet calculator
Enter an address and its prefix length, for example 192.168.1.0/24, or an address followed by its mask. The subnet calculator instantly shows the network, mask, range, broadcast and number of usable addresses, in IPv4 and IPv6 alike, and splits the block into subnets.
- IPv4 and IPv6, CIDR or mask
- Subnet splitting
- Calculated in your browser

Every detail of a network, in real time
The calculator applies the mask to the address entered and works out all the information you need for an addressing plan or a firewall rule.
Network and range
The network address, even if you entered an address in the middle of the block, the first and last address in the range and the total number of addresses.
Mask and wildcard mask
The mask in dotted notation and in binary, the prefix length and the wildcard mask used in router access control lists.
Usable addresses
The first and last assignable addresses, the broadcast address and how many there are, with correct handling of the special /31 and /32 cases, which have no broadcast address.
Subnet splitting
Up to sixteen extra prefix bits, with the number of subnets obtained, their network address and the range of each one. The first 64 are listed in detail.
IPv4 and IPv6
Both protocols are supported, with exact address counts even for very large IPv6 blocks and addresses written in compact form.
Address type
RFC 1918 private, loopback, CGNAT, link-local, multicast or public in IPv4, and ULA, link-local, documentation or global in IPv6, so you can see the nature of a block at a glance.
Calculate an IP network in four steps
Enter the network
In CIDR notation such as 192.168.1.0/24 or 2001:db8::/48, or an IPv4 address followed by its mask, such as 10.0.0.1 255.255.0.0.
Read the result
Network, mask, range, broadcast and usable addresses appear as you type, with no button to click and no page to reload.
Split if needed
Choose a prefix length from the “Split into” list to get the subnets and the exact range of each one.
Apply the configuration
Copy the values into your router, firewall, DHCP server or SPF record, then check that everything works.
Subnet calculator: understanding CIDR notation
An IP address identifies a machine on a network. In IPv4, it has 32 bits, written as four numbers from 0 to 255 separated by dots, such as 192.168.1.10. In IPv6, it has 128 bits, written as eight hexadecimal groups separated by colons, such as 2001:db8::10.
Each address is split into two parts. The left part identifies the network, the right part identifies the host within that network. CIDR notation, defined by RFC 4632, shows where the boundary lies: you write the address, a slash, then the number of bits reserved for the network. This is the prefix length.
In 192.168.1.0/24, the first 24 bits identify the network and the last 8 number the hosts. Eight bits allow 2 to the power of 8 combinations, which is 256 addresses. The longer the prefix, the smaller the network: a /25 contains 128 addresses, a /26 contains 64, a /30 only 4.
The subnet calculator does all these calculations for you. You enter an address and its prefix, and it gives you the network address, the mask, the full range, the number of addresses, the usable addresses and, if you wish, the split into smaller subnets.
Why CIDR replaced classes
In the early days of the internet, IPv4 networks were divided into fixed-size classes: class A corresponded to a /8, class B to a /16 and class C to a /24. An organisation that needed 500 addresses had to choose between a class C network that was too small and a class B network of 65,536 addresses, far too big. CIDR, introduced in 1993, removed these categories: a network can now have any prefix length. This saved IPv4 addresses and reduced the size of routing tables. The expressions “class C” or “class B” survive in everyday language, but they no longer have any technical meaning.
The subnet mask explained simply
Before CIDR notation, the size of an IPv4 network was described with a subnet mask, which is still widely used in the configuration of computers, home routers and enterprise routers. The mask is a 32-bit address in which the network bits are 1 and the host bits are 0. A /24 therefore corresponds to 24 bits set to 1 followed by 8 bits set to 0, which is 255.255.255.0.
To find the network of an address, you apply a bitwise logical AND between the address and the mask. Take 192.168.1.77/26:
Address 192.168.1.77 11000000.10101000.00000001.01001101
Mask 255.255.255.192 11111111.11111111.11111111.11000000
Network 192.168.1.64 11000000.10101000.00000001.01000000
Broadcast 192.168.1.127 11000000.10101000.00000001.01111111The address 192.168.1.77 therefore belongs to the network 192.168.1.64/26, which runs from .64 to .127. Hosts can use addresses .65 to .126. This is exactly what the calculator shows, with the mask written in binary as a bonus so you can check the reasoning.
The wildcard mask, also called the inverse mask, does the opposite: the host bits are 1. For a /26, it is 0.0.0.63. You come across it in some router access control lists and in the configuration of routing protocols.
How to use the subnet calculator
The calculator accepts three ways of writing a network:
- CIDR notation, in IPv4 or IPv6:
192.168.1.0/24,10.0.0.0/8,2001:db8::/48. - An address followed by its mask, in IPv4:
10.0.0.1 255.255.0.0. The tool converts the mask into a prefix length and rejects a non-contiguous mask, such as 255.0.255.0, which does not correspond to any valid network. - An address on its own: it is treated as a single-address network, /32 in IPv4 and /128 in IPv6.
You can enter any address in the network, not just the first one: 192.168.1.77/24 gives the same result as 192.168.1.0/24. The calculation updates with every character you type, with no button to click. To split the network, choose a new prefix length from the “Split into” list: each option shows in brackets the number of subnets obtained.
The whole calculation is done in your browser. Your addressing plans and internal addresses are not sent to any server.
Reading each line of the result
For an IPv4 network, the calculator shows the following lines:
- Network: the first address in the block followed by the prefix. It identifies the network itself and is not assigned to a host.
- Mask: the mask in dotted notation, with the prefix length in brackets.
- Wildcard mask: the complement of the mask, useful for access control lists.
- Range: from the first to the last address in the block.
- Number of addresses: the total size of the block, 2 to the power of the number of host bits.
- First and last usable addresses: the bounds of the addresses you can assign to computers, servers or printers.
- Broadcast: the last address in the block, which reaches every host on the network at once.
- Usable addresses: the number of assignable addresses, which is the total minus two.
- Address type: the category of the network, detailed below.
- Mask in binary: the 32 bits of the mask, grouped by byte.
The address types recognised
In IPv4, the tool recognises the RFC 1918 private ranges (10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16), the loopback range 127.0.0.0/8, the carrier-shared addresses 100.64.0.0/10 used for CGNAT, the link-local range 169.254.0.0/16 that a machine assigns itself when there is no DHCP server, and multicast from 224.0.0.0 to 239.255.255.255. Other networks are classed as public.
In IPv6, it distinguishes unique local addresses (ULA, fc00::/7), link-local addresses (fe80::/10), addresses reserved for documentation (2001:db8::/32) and global addresses.
The special /31 and /32 cases
A /32 identifies a single host, for example in a firewall rule. A /31 contains two addresses and is used for point-to-point links between two routers, as allowed by RFC 3021. In both cases, there is no network address and no broadcast address to subtract: every address is usable and the Broadcast line simply shows a dot.
Splitting a network into subnets
Splitting a network means lengthening its prefix. Each added bit cuts the block in two: a /24 gives two /25s, four /26s, eight /27s or sixteen /28s. The calculator offers up to sixteen extra bits and shows the list of subnets obtained, with their range. Here is a /24 split into /26s:
# Network Range
1 192.168.1.0/26 192.168.1.0 - 192.168.1.63
2 192.168.1.64/26 192.168.1.64 - 192.168.1.127
3 192.168.1.128/26 192.168.1.128 - 192.168.1.191
4 192.168.1.192/26 192.168.1.192 - 192.168.1.255When the split produces a large number of subnets, only the first 64 are listed, but the total number is still shown in the heading.
Sizing each subnet correctly
Start from the number of machines to connect, add a margin for growth, then choose the smallest block that fits. For 50 computers, a /26 and its 62 usable addresses are enough. For 120 computers, you need a /25. Separating uses into distinct subnets, for example computers, servers, telephony and guest Wi-Fi, then makes firewall rules easier to write. Finally, make sure that two subnets never overlap: the calculator shows you the exact range of each one.
Calculating an IPv6 network
In IPv6, the orders of magnitude change completely. An address has 128 bits, and the standard local network is a /64, which contains 18,446,744,073,709,551,616 addresses. This size is not a waste: it is expected by stateless address autoconfiguration (SLAAC), which builds the host part from the last 64 bits.
A site usually receives a larger block from its provider, often a /48 or a /56, which it splits into /64s. A /56 contains 256 /64 networks, a /48 contains 65,536. With the calculator, enter 2001:db8:abcd::/48 then choose “/64” from the list: you get the list of the first subnets and their total number.
IPv6 has no broadcast address. For this protocol, the calculator therefore shows the network, the prefix length, the range, the exact number of addresses and the type, without the broadcast or usable address lines. Addresses are written in their compact form, where the longest run of zero groups is replaced by ::.
Use cases and common pitfalls
- Addressing plan: choose a private range that does not clash with that of your remote sites or your VPN. Many home routers use 192.168.0.0/24 or 192.168.1.0/24, so a different range avoids collisions.
- Firewall rules and allow lists: authorise a whole block rather than a list of addresses, checking that the block does not spill over onto addresses you do not control.
- Misaligned block:
192.168.1.77/26does not mean a network starting at .77, but the network 192.168.1.64/26. The calculator always shows the real network address. - Forgetting the two reserved addresses: a /30 leaves only 2 usable addresses out of 4, a /29 leaves 6 out of 8.
- Confusing private ranges: 172.16.0.0/12 covers 172.16.0.0 to 172.31.255.255, not every address starting with 172.
To find the public address your connection uses on the internet, use the what is my IP address tool. To find out which name is linked to an address, run a reverse DNS lookup.
Checking a configuration by hand
On a Linux machine, the command ip -4 addr show shows each address with its prefix length, for example 192.168.1.10/24. On Windows, ipconfig gives the address and the subnet mask on two separate lines. For a quick calculation in a script, Python's ipaddress module is enough:
python3 -c "print(__import__('ipaddress').ip_network('192.168.1.77/26', strict=False))"
192.168.1.64/26
IP addresses, ranges and email
Address ranges play a direct role in the deliverability of your emails. A domain's SPF record lists the servers allowed to send on its behalf, and it accepts CIDR notation. A single line is enough to authorise a whole block:
v=spf1 ip4:198.51.100.0/24 ip6:2001:db8:1::/48 -allUsing a block rather than a series of addresses keeps the record short, without using up a DNS lookup, unlike mechanisms such as include, which count towards the limit of ten lookups. But a block that is too wide also authorises machines that do not belong to you: check its exact range with the calculator before publishing it. The SPF generator helps you write the record, and the SPF, DKIM and DMARC checker checks the result once it is published.
If one of your sending servers has been reported, the blacklist check tells you which lists its address appears on. And for your inboxes, Passmundi protection filters spam, viruses and phishing before they arrive, without changing your email service: discover the Passmundi plans.
The most common IPv4 prefixes
| Prefix | Mask | Addresses (usable) |
|---|---|---|
| /8 | 255.0.0.0 | 16,777,216 (16,777,214) |
| /16 | 255.255.0.0 | 65,536 (65,534) |
| /24 | 255.255.255.0 | 256 (254) |
| /26 | 255.255.255.192 | 64 (62) |
| /29 | 255.255.255.248 | 8 (6) |
| /30 | 255.255.255.252 | 4 (2) |
| /32 | 255.255.255.255 | 1 (1) |
Subnet calculation: all your questions
How do I calculate a subnet mask?
Write as many bits set to 1 as the prefix length, fill the rest with 0 up to 32 bits, and convert each group of 8 bits to decimal. For a /26, that gives 26 bits set to 1, which is 255.255.255.192. The subnet calculator does this instantly and also shows the mask in binary so you can check.
How do I find the network address from an IP address?
Apply a bitwise logical AND between the address and the mask: the host bits are reset to zero. For example, 192.168.1.77 with a /26 mask gives the network 192.168.1.64. Simply enter the address and its prefix in the subnet calculator: the Network line shows the result directly, along with the full range.
What does /24 mean in an IP address?
The /24 is the prefix length in CIDR notation. It means that the first 24 bits of the address identify the network and the remaining 8 bits number the hosts. A /24 corresponds to the mask 255.255.255.0 and contains 256 addresses, 254 of which can be used for computers, servers or printers.
How many IP addresses are in a /24, a /16 or a /8?
A /24 contains 256 addresses, a /16 contains 65,536 and a /8 contains 16,777,216. In IPv4, you need to subtract two addresses from each block, the network address and the broadcast address, to get the number of assignable addresses. The subnet calculator shows both values, the total size and the usable addresses.
Why are two addresses subtracted in an IPv4 network?
Because the first address in a block identifies the network itself and the last one is used for broadcast, to reach every host at once. Neither can be assigned to a device. The exceptions are /31 networks, used for point-to-point links under RFC 3021, and /32 networks, which identify a single address.
What is the difference between a subnet mask and a wildcard mask?
The subnet mask marks the network bits with 1s, for example 255.255.255.0 for a /24. The wildcard mask, or inverse mask, marks the host bits with 1s instead, which is 0.0.0.255 for the same network. The latter is mainly used in some router access control lists and in the configuration of routing protocols.
How do I split a network into subnets?
Lengthen the prefix: each added bit divides the network in two. A /24 gives two /25s, four /26s or eight /27s. In the subnet calculator, choose the new length from the “Split into” list: you get the number of subnets and the range of each one, with the first 64 listed in detail.
What are the private IP address ranges?
RFC 1918 reserves three ranges for private networks: 10.0.0.0/8, 172.16.0.0/12, which runs from 172.16.0.0 to 172.31.255.255, and 192.168.0.0/16. These addresses are not routed on the internet and can be used freely on a local network. The subnet calculator automatically shows whether a network you enter belongs to one of these ranges.
What subnet size should I use in IPv6?
A /64 per local network: that is the size expected by stateless address autoconfiguration (SLAAC). A site usually receives a larger block, often a /48 or a /56, which it splits into /64s. A /56 gives 256 /64 networks and a /48 gives 65,536. The subnet calculator handles this split in IPv6.
How do I authorise an IP address range in an SPF record?
Add an ip4 or ip6 mechanism followed by the range in CIDR notation, for example ip4:198.51.100.0/24. This mechanism uses none of the ten DNS lookups allowed by SPF. First check with the subnet calculator that the range only covers your own servers, then check the published record with an SPF checker.
Is the subnet calculator free?
Yes, it is completely free and requires no sign-up. There is no usage limit, because all the calculations are done in your browser. You can use it to prepare an addressing plan, check a firewall rule or revise for a networking exam, in IPv4 and IPv6 alike, as often as you need.
Are my IP addresses sent to a server?
No. The calculation is done entirely in your browser, in JavaScript. The addresses and addressing plans you enter are not sent to any server and are not stored. You can therefore work on internal addresses or on the configuration of a corporate network without worrying about disclosing this information.
All our free tools, in one place
25 free tools, no sign-up needed, to check your email, your domain and your website. Each one gives a clear result and the steps to follow.
Email and deliverability 10
An A to F grade for your domain, with the exact fix to publish for each issue.
- SPF, DKIM and DMARC read and explained
- DMARC policy and alignment
- Fixes ready to copy
Free domain security check: SPF, DKIM, DMARC, MTA-STS, blacklists, certificate and lookalike domains. Get an A to F grade and fixes ready to copy.
- A to F grade in 20 to 40 seconds
- Fixes ready to copy
- Free weekly monitoring
Send a message to a test address and get a score out of 100: authentication, reputation, content.
Open the toolWhere your mail arrives, in what order, and whether it goes through a filter before your inbox.
Open the toolYour DMARC record in one minute, with the right policy to get started safely.
Open the toolA correct SPF built from your sending services, without exceeding the ten lookup limit.
Open the toolPaste a message's headers: route, delays and authentication checks translated into plain English.
Open the toolEncryption enforced between servers, TLS reports, brand logo and DNSSEC in a single test.
Open the toolIs your IP address or domain on anti-spam lists? Thirteen lists checked.
Open the toolA professional signature in six steps, compatible with every mail app.
Open the toolDomains and DNS 6
All of a domain's records, A, MX, TXT, NS, CAA and the rest, on the resolver of your choice.
- Every record type
- A choice of seven public resolvers
- Explanations for each value
Is a change already visible everywhere? The answer from nineteen resolvers around the world.
Open the toolThe name associated with an IP address, checked in both directions, just as mail servers do.
Open the toolRegistrar, creation and expiry dates, name servers and status of a domain or an IP.
Open the toolNames close to yours that are already registered, which fraudsters could use against your customers.
Open the toolAccented domains and the xn-- form, in both directions, with detection of misleading characters.
Open the toolWebsites and security 8
An A to F grade, Core Web Vitals, image-by-image loading and advice, on mobile and desktop.
- Google metrics and server analysis
- Request waterfall and page weight
- PDF report to share
Cookies before and after consent, banner, providers and a GDPR register ready to publish.
Open the toolValidity, issuer, chain, names covered and expiry date of a certificate, on any port.
Open the toolThe redirect chain of an address and the grade of its security headers.
Open the toolYour public IP address, IPv4 and IPv6, its name, its operator and its country.
Open the toolDownload and upload speed, latency and jitter of your connection, measured live in your browser.
Open the toolRanges, masks, subnets and number of addresses of an IPv4 or IPv6 network.
Strong passwords and passphrases, created in your browser, never sent.
Open the toolMigration and handy tools 1
Copy all the messages from one mailbox to another, folders and dates included, without deleting anything.
Open the toolBehind every IP address, emails to sort
Your address ranges are properly calculated. Passmundi takes care of what arrives in your mailboxes: spam, viruses, phishing and spoofing filtered before delivery, without changing your email service.