Technology calculators

Netmask Calculator

Updated Sep 5, 2026 By Jehan Wadia
Rate Formulas

IPv4 Inputs

Example: 192.168.1.10 or 192.168.1.0/24 — CIDR is detected and applied automatically.
Network Class
Filters the prefix lists: Any /1–/32, A /8–/15, B /16–/23, C /24–/32.
Mask · prefix · total IP count.
Picks the smallest mask that fits that many usable hosts.
Subnets created inside the classful block of this address.
IPv4 Results
IP Address
Network Address
Netmask
CIDR Notation
Prefix Length
Wildcard Mask
Block Size (Total IPs)
Usable Hosts
Host Address Range
First Usable Host
Last Usable Host
Broadcast Address

Binary Representation

IP:
Mask:

Bold & underlined = network bits  |  Normal weight = host bits

Step-by-Step Solution

Block Size by Prefix Length

Total addresses (logarithmic scale) for prefixes around your selection; the highlighted bar is your current prefix.

Subnet Details

Subnets produced by the selected prefix.
Subnet # Network Address First Usable Host Last Usable Host Broadcast Address CIDR Notation
Page 1 of 1

CIDR Block Decomposition — Network List

The usable host range of your subnet, broken into the smallest set of aligned CIDR blocks that exactly cover it (useful for route summarisation and ACLs).

CIDR blocks covering the usable host range.
#CIDR BlockBlock SizeIP Range

Full IP Enumeration — IP List

    Page 1 of 1

    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.

    CIDRNetmaskTotal IPsUsable Hosts
    /8255.0.0.016,777,21616,777,214
    /16255.255.0.065,53665,534
    /24255.255.255.0256254
    /26255.255.255.1926462
    /30255.255.255.25242

    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.


    Formulas used

    Host bits from prefix length
    h = 32 - p
    Block size (total addresses)
    S = 2^{32-p}
    Netmask value from prefix
    M = 2^{32} - 2^{32-p}
    Network address (IP AND mask)
    N = \left\lfloor \frac{IP}{S} \right\rfloor \times S = IP \;\text{AND}\; M
    Wildcard mask
    W = 2^{32} - 1 - M
    Broadcast address
    B = N + S - 1 = N \;\text{OR}\; W
    Usable hosts
    U = \begin{cases} 2^{32-p} - 2 & p \le 30 \\ 2 & p = 31 \\ 1 & p = 32 \end{cases}
    Number of subnets within the classful block
    n = 2^{\,p - p_{base}}

    Frequently asked questions

    How do I find the subnet mask on my computer?

    It takes one command:

    • Windows: open Command Prompt and type ipconfig. Look at the line "Subnet Mask".
    • Mac: go to System Settings > Network > your connection > Details > TCP/IP.
    • Linux: type ip addr. The mask shows as a CIDR prefix, like /24.

    Most home computers show 255.255.255.0.

    Can two devices with different subnet masks talk to each other?

    Often not, and the problem can be hard to spot. Each device uses its own mask to decide who is local. If one device thinks the other is on the same network and the other does not, traffic goes out one way and gets lost coming back.

    Example: 192.168.1.10/24 and 192.168.1.20/25 sit in the same address space but do not agree on the network size. Always give every device on one subnet the same mask.

    What subnet mask should I use for a home network?

    Use 255.255.255.0 (/24). It gives 254 usable addresses, which is far more than a home needs, and almost every router ships with it by default.

    Only change it if you split your home into VLANs, like a guest network or an IoT network. Then a /25 or /26 per group still leaves room to grow.

    Why can't the network address and broadcast address be used for devices?

    They are reserved. The first address in a block names the network itself, and routers use it in routing tables. The last address is the broadcast address, which sends one packet to every host in that subnet.

    That is why a /24 has 256 addresses but only 254 usable ones. The exception is a /31, where both addresses are usable on point-to-point links.

    What is the difference between a subnet mask and a default gateway?

    The subnet mask tells a device which addresses are local. The default gateway is the address of the router that handles everything that is not local.

    Your device first uses the mask to check the destination. If it is inside the subnet, it sends the packet straight there. If it is outside, it hands the packet to the gateway.

    What does 0.0.0.0/0 mean?

    It means every IPv4 address. Zero network bits match nothing specific, so all 4.3 billion addresses fit. Routers use 0.0.0.0/0 as the default route: if no better route matches, send the packet here.

    In firewall rules, 0.0.0.0/0 means "any source" or "any destination", so use it with care.

    What does the mask 255.255.255.255 mean?

    That is a /32 mask. All 32 bits are network bits, so the block holds exactly one address. It points at a single host.

    You see /32 in host routes, loopback addresses on routers, and firewall rules that allow just one IP.

    How many subnets can I make from a /24?

    It depends on how many host bits you borrow:

    New prefixSubnetsUsable hosts each
    /252126
    /26462
    /27830
    /281614
    /29326
    /30642

    Each extra bit doubles the subnet count and halves the hosts.

    How do I find the network address by hand?

    Line up the IP and the mask in binary and keep a bit only when both are 1. That is a bitwise AND.

    Quick shortcut: find the block size, which is 256 minus the last non-zero mask number. For 192.168.1.100 with mask 255.255.255.192, the block size is 64. Count 0, 64, 128, 192. The IP 100 falls in the 64 block, so the network is 192.168.1.64 and the broadcast is 192.168.1.127.

    What is VLSM in subnetting?

    VLSM stands for Variable Length Subnet Mask. It lets you use different mask sizes inside one network instead of cutting every subnet the same size.

    Example: give a 100-user office a /25, a 20-user office a /27, and a router-to-router link a /30. This saves a lot of addresses compared to giving everyone a /24.

    What is a supernet?

    A supernet is several smaller networks joined into one larger block with a shorter prefix. For example, 192.168.0.0/24 and 192.168.1.0/24 combine into 192.168.0.0/23.

    Routers use this trick, called route summarization, to advertise one route instead of many. Smaller routing tables mean faster lookups.

    Which IP address ranges are private?

    Three IPv4 ranges are set aside for private use and never routed on the internet:

    • 10.0.0.0/8 (10.0.0.0 to 10.255.255.255)
    • 172.16.0.0/12 (172.16.0.0 to 172.31.255.255)
    • 192.168.0.0/16 (192.168.0.0 to 192.168.255.255)

    Your router uses NAT to translate these to one public address when traffic leaves your network.

    Does a smaller subnet make my network faster?

    It does not raise your link speed. What it does is cut broadcast traffic. Every broadcast in a subnet is processed by every device in it, so a huge flat subnet with thousands of hosts wastes CPU and bandwidth.

    Splitting into smaller subnets lowers that noise and makes traffic easier to control and troubleshoot.

    Why do Cisco access lists use wildcard masks instead of subnet masks?

    A wildcard mask marks which bits to ignore. A 0 means the bit must match, and a 1 means the bit can be anything. That is the opposite of a subnet mask.

    This gives more freedom than a subnet mask. You can match a whole subnet with 0.0.0.255, one host with 0.0.0.0, or even every odd-numbered subnet using a pattern a normal mask cannot express.

    Why do IPv6 subnets almost always use /64?

    A /64 leaves 64 host bits, which is what SLAAC (stateless address autoconfiguration) needs to build addresses from a device's MAC address. Many features break if the subnet is smaller.

    Even though a /64 holds about 18 quintillion addresses for a handful of devices, ISPs hand out /48 or /56 blocks, so you have plenty of /64s to spare.