Enter an IPv4 address and CIDR prefix length to calculate the subnet mask, network address, broadcast address, wildcard mask, first and last usable host, and total number of hosts. Supports all prefix lengths from /0 to /32.
Select a division above to split this subnet.
IP address: -
Subnet mask: -
Network address: -
Green = network bits (fixed) Amber = host bits (variable)
Every IPv4 address is a 32-bit number, written as four octets (groups of 8 bits) separated by dots. The address is split into two parts: the network portion (which identifies the subnet) and the host portion (which identifies individual devices within the subnet). The subnet mask defines where this boundary falls. In CIDR (Classless Inter-Domain Routing) notation, the prefix length after the slash tells you how many bits belong to the network.
Given an IPv4 address and a prefix length n:
The default values in this calculator use 192.168.1.0/24, the most common home and small office network range. Here is how the results are derived:
| Field | Value | Working |
|---|---|---|
| Prefix length | /24 | 24 network bits, 8 host bits |
| Subnet mask | 255.255.255.0 | 24 ones followed by 8 zeros in binary |
| Wildcard mask | 0.0.0.255 | Inverse of subnet mask |
| Network address | 192.168.1.0 | 192.168.1.0 AND 255.255.255.0 |
| Broadcast address | 192.168.1.255 | 192.168.1.0 OR 0.0.0.255 |
| First usable host | 192.168.1.1 | Network address + 1 |
| Last usable host | 192.168.1.254 | Broadcast address - 1 |
| Total addresses | 256 | 2^8 = 256 |
| Usable hosts | 254 | 256 - 2 = 254 |
| CIDR | Subnet Mask | Total Addresses | Usable Hosts |
|---|---|---|---|
| /8 | 255.0.0.0 | 16,777,216 | 16,777,214 |
| /16 | 255.255.0.0 | 65,536 | 65,534 |
| /20 | 255.255.240.0 | 4,096 | 4,094 |
| /22 | 255.255.252.0 | 1,024 | 1,022 |
| /24 | 255.255.255.0 | 256 | 254 |
| /25 | 255.255.255.128 | 128 | 126 |
| /26 | 255.255.255.192 | 64 | 62 |
| /27 | 255.255.255.224 | 32 | 30 |
| /28 | 255.255.255.240 | 16 | 14 |
| /29 | 255.255.255.248 | 8 | 6 |
| /30 | 255.255.255.252 | 4 | 2 |
| /31 | 255.255.255.254 | 2 | 2 (RFC 3021) |
| /32 | 255.255.255.255 | 1 | 1 (host route) |
Three IPv4 ranges are reserved for private use and are not routed on the public internet. These are used for internal networks behind NAT (Network Address Translation):
Sources and method: IPv4 subnetting per RFC 950 (Internet Standard Subnetting Procedure). CIDR notation per RFC 4632 (Classless Inter-domain Routing). /31 point-to-point host addressing per RFC 3021. All calculations are performed in 32-bit unsigned integer arithmetic in the browser.
This tool handles IPv4 addresses only. IPv6 subnetting uses 128-bit addresses and different notation. All results are computed client-side and no data is transmitted to any server.
If you've found a bug, or would like to contact us, or learn more about James Graham and Calculate.co.nz.
Calculate.co.nz is partnered with Interest.co.nz for New Zealand's highest quality calculators and financial analysis.
Calculate.co.nz is the sister site of CalculatorHub.com, the world's largest calculator website by tool count.
All calculators and tools are provided for educational and indicative purposes only and do not constitute financial advice.
Calculate.co.nz is proudly part of the Realtor.co.nz group, New Zealand's leading property transaction literacy platform, helping Kiwis understand the home buying and selling process from start to finish. Whether you're a first home buyer navigating your first property purchase, an investor evaluating your next acquisition, or a homeowner planning to sell, Realtor.co.nz provides clear, independent, and trustworthy guidance on every step of the New Zealand property transaction journey.
Calculate.co.nz is also partnered with Health Based Building and Premium Homes to promote informed choices that lead to better long-term outcomes for Kiwi households.
Calculate.co.nz is hosted in Auckland via SiteHost new Zealand.
All content on this website, including calculators, tools, source code, and design, is protected under the Copyright Act 1994 (New Zealand). No part of this site may be reproduced, copied, distributed, stored, or used in any form without prior written permission from the owner.
About & trust: Why Calculate is NZ's most comprehensive · By the Numbers · How we compare · Editorial standards · How we keep data current · NZ finance glossary · Research & data · Financial literacy NZ · About · Privacy policy · Terms of use
Reviewed and maintained. Last reviewed 2026-07-02 and checked on a twice-monthly cycle against IRD, RBNZ and Stats NZ. How we keep data current.
© 2026 Calculate.co.nz. All rights reserved. Building free NZ calculators since 2011.