IPv4 Subnet Calculator: Network, Broadcast, Host Range and Subnetting
How the subnet calculator works: the prefix length says how many bits belong to the network. 192.168.1.10/24 is in network 192.168.1.0 with broadcast 192.168.1.255 and 254 usable hosts. Enter an IP and prefix (or “10.0.0.5/20”) – everything runs locally in your browser.
Source: RFC 4632, RFC 4632 – Classless Inter-domain Routing (CIDR): prefix notation. Updated: .
How it is calculated
How subnet calculation works
An IPv4 address has 32 bits. The prefix length (CIDR notation, RFC 4632) tells how many bits from the left identify the network; the remaining bits number the hosts.
- Network address = IP AND subnet mask (all host bits 0)
- Broadcast = network OR inverted mask (all host bits 1)
- Usable hosts = 232 − prefix − 2
Example: 192.168.1.10/26
- Mask /26 = 11111111.11111111.11111111.11000000 = 255.255.255.192
- Last octet: 10 = 00001010, AND 11000000 = 00000000 → network 192.168.1.0
- Host bits set to 1: 00111111 = 63 → broadcast 192.168.1.63
- Hosts: 2⁶ − 2 = 62, range 192.168.1.1 – 192.168.1.62
Subnet cheat sheet
| Prefix | Mask | Hosts |
|---|---|---|
| /8 | 255.0.0.0 | 16,777,214 |
| /16 | 255.255.0.0 | 65,534 |
| /24 | 255.255.255.0 | 254 |
| /25 | 255.255.255.128 | 126 |
| /26 | 255.255.255.192 | 62 |
| /27 | 255.255.255.224 | 30 |
| /28 | 255.255.255.240 | 14 |
| /29 | 255.255.255.248 | 6 |
| /30 | 255.255.255.252 | 2 |
Private and special ranges
RFC 1918 reserves 10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16 for private networks. Other special-purpose blocks (loopback 127.0.0.0/8, link-local 169.254.0.0/16, carrier-grade NAT 100.64.0.0/10) are listed in the IANA registry defined by RFC 6890. The calculator tells you which range an address falls into.
Subnetting
“Split into subnets” divides the network into equal parts with a longer prefix: a /24 split into /26 gives four networks of 62 hosts (.0, .64, .128, .192). Every extra bit doubles the number of subnets and halves their size.
Frequently asked questions
How do you calculate the network address?
Bitwise AND the IP address with the subnet mask. 192.168.1.130 with 255.255.255.192: 130 AND 192 = 128 → network 192.168.1.128.
How many hosts are in a /27?
2⁵ − 2 = 30 usable hosts out of 32 addresses; the mask is 255.255.255.224.
How many hosts are in a /29?
2³ − 2 = 6 usable hosts out of 8 addresses; mask 255.255.255.248.
What is a broadcast address?
The last address of a subnet, with all host bits set to 1. Packets sent there reach every device in the subnet; it cannot be assigned to a host.
What is a wildcard mask?
The inverted subnet mask, e.g. 0.0.0.255 for /24, used in Cisco ACLs and OSPF network statements.
Does it support IPv6?
No – this calculator is for IPv4. IPv6 subnets are usually /64; the prefix logic is the same but with 128 bits.
Sources and legal basis
- RFC 4632: RFC 4632 – Classless Inter-domain Routing (CIDR): prefix notation
- RFC 1918: RFC 1918 – Address Allocation for Private Internets
- RFC 6890: RFC 6890 – Special-Purpose IP Address Registries
- RFC 3021: RFC 3021 – Using 31-Bit Prefixes on IPv4 Point-to-Point Links
- RFC 5737: RFC 5737 – IPv4 Address Blocks Reserved for Documentation
As of: · Editorial policy
Related tools
- What is my IP address?What is my IP? See your public IPv4 or IPv6 address at once, plus approximate location, internet provider and browser details. Free, never stored.
- Number base converter with stepsConvert between binary, octal, decimal, hex and any base from 2 to 36 – with full working, fractions, repeating digits and two’s complement (8–64 bit).
- DNS lookupDNS lookup for any domain: A, AAAA, MX, TXT, CNAME, NS, SOA, CAA, SRV and PTR, all at once if you like, plus an SPF, DMARC and DKIM check in plain words.
- What is my user agent?See your user agent string and detect browser, version, engine, OS and device type, plus User-Agent Client Hints. Parse any other UA too. Runs locally.
- ASCII table with decimal, hex, octal, binary and Unicode lookupASCII table 0–127 plus Latin-1 and Windows-1252: decimal, hex, octal, binary, HTML entity, control codes. Search it, click to copy, convert text to codes.
- Binary to decimal and decimal to binary converterBinary to decimal: add the powers of 2 where there is a 1, so 1011 = 11. Type bits for decimal, hex and octal, or go back from decimal, with the working.
- Markdown table generatorMarkdown table generator: paste data from Excel, Google Sheets or CSV and copy it as an aligned Markdown, HTML or LaTeX table – locally in your browser.
- Screen size calculatorScreen size calculator: width and height in cm and inches from the diagonal and aspect ratio, plus pixel density (ppi), pixel size and the distance pixels blur.
- Font pairing – heading and body font combinationsFont pairs for headings and body text with live preview, copy-ready CSS and availability on Windows, Mac, iPhone and Android – system fonts only, no web fonts.