Subnet Calculator

Free IPv4 CIDR Calculator — Instant Results

Enter any IP address in CIDR notation to instantly calculate network address, broadcast address, first and last host, subnet mask, wildcard mask, and usable host count. No page reloads — all math runs in your browser.

Free — no account needed
Instant — runs entirely in your browser
Shareable URLs — bookmark any calculation

Calculate Subnet

Enter CIDR notation or IP + mask

Try: , ,

IPv4 Subnet Cheat Sheet

All 33 CIDR prefixes — /0 through /32 — with subnet mask, wildcard, host counts, and common uses

CIDR Subnet Mask Wildcard Mask Total IPs Usable Hosts Common Use
/00.0.0.0255.255.255.2554,294,967,2964,294,967,294Default route (entire Internet)
/1128.0.0.0127.255.255.2552,147,483,6482,147,483,646Half of address space
/2192.0.0.063.255.255.2551,073,741,8241,073,741,822Quarter of address space
/3224.0.0.031.255.255.255536,870,912536,870,910Eighth of address space
/4240.0.0.015.255.255.255268,435,456268,435,454Large ISP block
/5248.0.0.07.255.255.255134,217,728134,217,726Large ISP block
/6252.0.0.03.255.255.25567,108,86467,108,862Large ISP block
/7254.0.0.01.255.255.25533,554,43233,554,430Large ISP block
/8255.0.0.00.255.255.25516,777,21616,777,214Class A network (e.g. 10.0.0.0/8)
/9255.128.0.00.127.255.2558,388,6088,388,606Half class A
/10255.192.0.00.63.255.2554,194,3044,194,302Quarter class A
/11255.224.0.00.31.255.2552,097,1522,097,150Large enterprise block
/12255.240.0.00.15.255.2551,048,5761,048,574172.16.0.0/12 RFC 1918
/13255.248.0.00.7.255.255524,288524,286Large enterprise
/14255.252.0.00.3.255.255262,144262,142Large enterprise
/15255.254.0.00.1.255.255131,072131,070Large enterprise
/16255.255.0.00.0.255.25565,53665,534Class B / 192.168.0.0/16 RFC 1918
/17255.255.128.00.0.127.25532,76832,766Half class B
/18255.255.192.00.0.63.25516,38416,382Large campus network
/19255.255.224.00.0.31.2558,1928,190Medium campus network
/20255.255.240.00.0.15.2554,0964,094Medium network / AWS VPC default
/21255.255.248.00.0.7.2552,0482,046Small campus
/22255.255.252.00.0.3.2551,0241,022Small campus / AWS subnet
/23255.255.254.00.0.1.255512510Two merged /24s
/24255.255.255.00.0.0.255256254Class C / typical LAN segment
/25255.255.255.1280.0.0.127128126Half class C
/26255.255.255.1920.0.0.636462Quarter class C
/27255.255.255.2240.0.0.313230Small workgroup / VLAN
/28255.255.255.2400.0.0.151614Small office / DMZ segment
/29255.255.255.2480.0.0.786Small server cluster
/30255.255.255.2520.0.0.342Point-to-point WAN link
/31255.255.255.2540.0.0.122Point-to-point link (RFC 3021)
/32255.255.255.2550.0.0.011Host route / loopback

Note: Usable hosts = Total IPs − 2 (network + broadcast addresses). Exceptions: /31 uses both addresses for point-to-point links per RFC 3021; /32 is a single host route.

How IP Subnetting Works

CIDR Notation

CIDR (Classless Inter-Domain Routing) notation writes an IP address followed by a slash and a prefix length — for example 192.168.1.0/24. The prefix length tells you how many bits of the 32-bit IP address belong to the network part. The remaining bits identify individual hosts within that network.

Network & Broadcast Addresses

Every subnet has two reserved addresses that cannot be assigned to hosts. The network address (all host bits set to 0) identifies the subnet in routing tables. The broadcast address (all host bits set to 1) is used to send packets to every host on the subnet simultaneously. This is why a /24 has 256 total addresses but only 254 usable — two are reserved.

Subnet Mask & Wildcard Mask

The subnet mask is the CIDR prefix expressed in dotted-decimal: /24 becomes 255.255.255.0. The wildcard mask is its bitwise inverse: 0.0.0.255. Wildcard masks are used in ACLs and OSPF configurations to specify which bits of an address are significant.

Special Cases: /31 and /32

A /31 subnet (RFC 3021) is used for point-to-point links between two routers. Because there are only two addresses and no need for a broadcast, both are usable as host addresses. A /32 is a host route — a single IP address used for loopback interfaces and specific policy routes.

VLSM — Variable Length Subnet Masking

VLSM lets you carve an address block into subnets of different sizes. A 10.0.0.0/24 block could be split into one /26 (62 hosts), two /28s (14 hosts each), and eight /30s (2 hosts each) — all from the same /24. Modern protocols like OSPF and BGP carry the mask with every route, making VLSM the standard approach for efficient IP allocation.

Example: 192.168.1.0/24
Network address 192.168.1.0
Subnet mask 255.255.255.0
Wildcard mask 0.0.0.255
First host 192.168.1.1
Last host 192.168.1.254
Broadcast 192.168.1.255
Usable hosts 254
Binary mask (32-bit)
11111111.11111111.11111111.00000000
N
254 usable hosts
B

Pricing

Start using IP-API.io to make your website safer and more user-friendly. Keep out unwanted bots, show visitors content that's relevant to where they are, and spot risky IP addresses quickly. It's perfect for making online shopping more personal and keeping your site secure. Get started today with one of the plans!

Small

€10 /mo
100,000 geo ip requests
10,000 advanced email validation requests
Location data
Email validation
Risk score calculation
Currency data
Time zone data
Threat data
Unlimited support
HTTPS encryption

Medium

€20 /mo
300,000 geo ip requests
25,000 advanced email validation requests
Location data
Email validation
Risk score calculation
Currency data
Time zone data
Threat data
Unlimited support
HTTPS encryption
Note: Your API key will be sent to your email after the subscription is confirmed.

Frequently Asked Questions

Everything you need to know about subnet calculation and CIDR notation

A subnet calculator takes an IP address and a prefix length (CIDR notation, e.g. 192.168.1.0/24) and computes the network address, broadcast address, first and last usable host addresses, subnet mask, wildcard mask, and the number of usable hosts. It's an essential tool for network engineers, sysadmins, and developers planning IP address allocation — whether for on-premises infrastructure, cloud VPCs, or firewall ACLs.

Enter the IP address and prefix in the calculator above, for example 10.0.0.0/8. The tool instantly shows the subnet mask (255.0.0.0 for /8), wildcard mask, network address, broadcast address, and host range. You can also enter the mask directly as 10.0.0.0 255.0.0.0 — both formats are accepted. The subnet mask is derived by setting the first N bits to 1 and the remaining 32−N bits to 0, then writing it in dotted-decimal.

/24 means the first 24 bits of the IP address are the network part and the remaining 8 bits are for hosts. This gives a subnet mask of 255.255.255.0, a total of 256 addresses (0–255 in the last octet), and 254 usable host addresses — network (.0) and broadcast (.255) are reserved. The /24 is the most common subnet size — it maps to the old "Class C" network and is the default LAN segment in most home and office networks.

A /27 subnet has 32 total addresses (25 = 32, since 32−27 = 5 host bits). Two are reserved — the network address and the broadcast address — leaving 30 usable host addresses. The subnet mask is 255.255.255.224 and the wildcard mask is 0.0.0.31. A /24 can be split into exactly 8 /27 subnets.

The network address is the first address in a subnet (all host bits set to 0). It identifies the subnet itself and appears in routing tables — no device can be assigned this address. The broadcast address is the last address in the subnet (all host bits set to 1). Packets sent to the broadcast address are delivered to every host on that subnet simultaneously. Both are unusable as individual host addresses, which is why a /24 has only 254 usable hosts despite having 256 total addresses.

VLSM allows a network to be divided into subnets of different sizes rather than using a single uniform mask. For example, you can allocate a /30 (4 addresses, 2 usable) for a point-to-point link between routers, a /28 (16 addresses, 14 usable) for a small server cluster, and a /24 (256 addresses, 254 usable) for a large office LAN — all carved from the same larger block. Modern routing protocols like OSPF, EIGRP, and BGP carry the subnet mask with every route advertisement, making VLSM the standard approach for efficient IP address utilisation.

Two addresses in every IPv4 subnet are reserved by the IP protocol: the first address (network address) identifies the subnet in routing tables, and the last address (broadcast address) is used to reach all hosts on the subnet at once. The only exceptions are /31 subnets (RFC 3021), where both addresses are usable because there are only two hosts and no need for a broadcast domain, and /32, which is a single host route where the address is the host itself.

Need support?

Explore how IP-API.io can enhance your security, provide robust bot protection, and improve IP geolocation accuracy for your applications.

Contact Support

Need more queries?

Customize your experience with tailored plans that fit your IP security and geolocation needs.

Email Us