Introduction
A netmask calculator is a tool that breaks an IP address into its network part and its host part. You type in an IP address and pick a subnet mask or CIDR prefix, and the tool returns every value that goes with that block.
This calculator works with both IPv4 and IPv6. For IPv4, it shows you the network address, the netmask, the CIDR notation, the wildcard mask, the broadcast address, the block size, and how many usable hosts you get. It also shows the first and last host you can use. For IPv6, it expands the address, finds the network, and counts the total addresses in the block.
The output goes past plain numbers. The tool shows the address in binary, so you can see which bits are network bits and which are host bits. It walks you through each step of the math. It lists every subnet in your block, breaks your host range into clean CIDR blocks, and can list the single IP addresses one by one.
Network admins, students, and IT techs use this to plan subnets, set up routers, and write firewall rules. Just type an address like 192.168.1.10 or 192.168.1.0/24, choose your prefix, and click Calculate.
How to use our Netmask Calculator
Type an IP address and pick a subnet mask. The calculator shows your network address, netmask, wildcard mask, CIDR notation, broadcast address, usable host range, subnet tables, and a full IP list.
IPv4 Calculator tab: Use this tab for normal IPv4 addresses like 192.168.1.10.
IP Address (CIDR accepted): Type the IPv4 address you want to check. You can add a slash and prefix, like 192.168.1.0/24, and the tool sets the prefix for you.
Network Class: Pick Any, A, B, or C. This limits the prefix choices in the lists below. Any shows /1 to /32, A shows /8 to /15, B shows /16 to /23, and C shows /24 to /32.
Subnet Mask / CIDR Prefix: Choose the mask you want, such as 255.255.255.0 · /24. Each choice shows the mask, the prefix, and how many total IPs it holds.
Number of Hosts per Subnet: Pick how many usable hosts you need. The tool picks the matching prefix for you.
Number of Subnets: Pick how many subnets you want inside your class block. The mask and host count change to match.
IPv6 Calculator tab: Click this tab to work with IPv6 addresses instead.
IPv6 Address (CIDR accepted): Type an IPv6 address in short or full form, like 2001:db8::1 or 2001:db8::/32.
Prefix Length: Choose the prefix, from /1 to /128. Most IPv6 subnets use /64.
Calculate and Reset: Click Calculate to see your results and the step-by-step math. Click Reset to go back to the default values.
What Is a Netmask?
A netmask (also called a subnet mask) is a number that splits an IP address into two parts: the network part and the host part. The network part says which network a device belongs to. The host part names the device inside that network. Routers use the netmask to decide if traffic stays on the local network or must be sent somewhere else.
How the Bits Work
An IPv4 address has 32 bits, written as four numbers like 192.168.1.10. The netmask turns the first bits on (1s) and the rest off (0s). The 1s mark network bits. The 0s mark host bits.
- Netmask: 255.255.255.0
- CIDR prefix: /24 (24 network bits, 8 host bits)
- Total addresses: 28 = 256
- Usable hosts: 256 − 2 = 254
Two addresses in most subnets are reserved. The first one is the network address, and the last one is the broadcast address, which sends a message to every device in the subnet. That is why you subtract 2.
CIDR Notation
CIDR is a short way to write a mask. Instead of 255.255.255.0, you write /24. A smaller prefix number means a bigger network. A larger prefix number means a smaller network.
| CIDR | Netmask | Total IPs | Usable Hosts |
|---|---|---|---|
| /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 |
| /30 | 255.255.255.252 | 4 | 2 |
Wildcard Masks
A wildcard mask is the netmask flipped around. For 255.255.255.0, the wildcard is 0.0.0.255. Cisco routers and firewalls use wildcard masks in access lists (ACLs) and routing rules.
Network Classes
Old IP rules put addresses into classes based on the first number:
- Class A: 1 to 126, default /8
- Class B: 128 to 191, default /16
- Class C: 192 to 223, default /24
Today most networks use CIDR instead of classes, but class defaults still help you see how many subnets you make when you borrow host bits.
Special Cases: /31 and /32
A /31 has only two addresses and no broadcast. RFC 3021 lets both be used, so it is a good fit for links between two routers. A /32 is a single address, often used for a host route or a loopback.
IPv6 Prefixes
IPv6 addresses have 128 bits and use only prefix length, not dotted masks. The standard subnet size is /64, which leaves 64 host bits. IPv6 has no broadcast address, so every address after the network address can be used by a device.
Why Subnetting Matters
Subnetting breaks one big network into smaller ones. This cuts down broadcast traffic, keeps groups of devices apart for safety, and helps you use IP space without waste. Network admins use it every day for VLANs, cloud VPCs, firewall rules, and route summarization.