🧰 Developer tools

IPv4 subnet calculator (CIDR)

Type an IPv4 address such as 192.168.1.10/24, or enter the address and a prefix length. You get the network, broadcast, masks, host range and the number of usable hosts.

Free · no signup Runs in your browser

Network—

    How do I work out a subnet?

    Write the address in binary, keep the first n bits (the prefix length) and set the rest to zero to get the network address; set the rest to one to get the broadcast address. For 192.168.1.10/24 the mask is 255.255.255.0, the network is 192.168.1.0, the broadcast is 192.168.1.255 and the hosts run from 192.168.1.1 to 192.168.1.254, which is 2^(32 − 24) − 2 = 254 usable hosts. The calculator does this for any address and prefix, and splits the network into smaller subnets.

    Why we built this tool

    Anyone who has set up a home or office network, a cloud virtual network or a firewall rule has needed a subnet answer: how many addresses are in a /26, what is the broadcast address of 10.4.7.130/27, do these two ranges overlap, how do I carve a /24 into four equal parts? The arithmetic is binary and easy to slip on. This calculator gives the whole picture at once, in decimal and binary, and splits a block into smaller ones, with the special cases (/31 and /32) handled the way the standards describe.

    Everything is worked out in your browser. Nothing you enter is sent anywhere.

    How it works

    An IPv4 address is 32 bits, written as four numbers from 0 to 255. CIDR notation adds a slash and a prefix length, the number of leading bits that identify the network; the remaining bits identify hosts. The prefix length gives a mask with that many leading ones: /24 is 255.255.255.0 and /26 is 255.255.255.192. ANDing the address with the mask gives the network address, and setting all the host bits to one gives the broadcast address, which is the same as ORing the network with the wildcard mask (the mask inverted). A block with prefix p holds 2^(32 − p) addresses. In an ordinary subnet, up to /30, the first (network) and last (broadcast) addresses are not assigned to hosts, so there are two fewer usable hosts. A /31 has just two addresses and, under RFC 3021, both are used as hosts on a point-to-point link; a /32 is a single address. To split, the calculator divides the block into 2^(q − p) equal pieces of prefix q.

    How to use it

    • Type the address, with or without /prefix (192.168.1.10/24 or 192.168.1.10 with 24 in the prefix box).
    • Read the network, broadcast, masks, usable range and number of hosts.
    • To plan subnets, enter a longer prefix in 'Split into' (for example /26 for a /24) and read the list.
    • Check the Type line to see whether the address is in a private (RFC 1918) range.
    • Compare the binary rows when you need to see which bits are network and which are host.

    Common prefix lengths

    A quick reference.

    CIDR prefixes and their sizes
    PrefixSubnet maskAddressesUsable hosts
    /8255.0.0.016,777,21616,777,214
    /16255.255.0.065,53665,534
    /24255.255.255.0256254
    /25255.255.255.128128126
    /26255.255.255.1926462
    /27255.255.255.2243230
    /28255.255.255.2401614
    /29255.255.255.24886
    /30255.255.255.25242
    /31255.255.255.25422 (point-to-point)
    /32255.255.255.25511 (single host)

    Use cases

    • Planning a home, office or lab network
    • Setting up cloud networks (a VPC or virtual network) and subnets
    • Writing firewall, router and access-list rules
    • Checking whether two ranges overlap
    • Studying for a networking exam
    • Working out how many devices a block can hold

    Problems you may run into

    Most trouble is about the host bits.

    Problems you may run into, and what to do
    What you seeLikely causeWhat to do
    The address I entered is not the network addressIt is a host address inside the subnetThat is fine; the calculator shows the network it belongs to
    My cloud provider shows fewer usable addressesCloud networks reserve extra addresses in every subnetCheck your provider's documentation; the figures here are the standard ones
    The mask I have is not contiguousA mask must be ones followed by zerosUse a prefix length; masks like 255.0.255.0 are not valid CIDR
    'Enter an IPv4 address'A number above 255, a missing part or lettersUse four numbers from 0 to 255 separated by dots
    Two subnets overlapOne range falls inside the otherCompare the network and broadcast of each; they must not cross
    IPv6This tool is for IPv4 onlyIPv6 uses 128-bit addresses and a different convention

    Private addresses

    RFC 1918 sets aside three IPv4 blocks for private networks, which are not routed on the public internet: 10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16. Home routers usually hand out addresses from 192.168.0.0/16 or 10.0.0.0/8. The tool tells you when the address you enter is in one of these ranges. Public addresses are allocated by registries, and for Canada by ARIN; this tool does not look up who owns an address.

    The formula

    How the answer is worked out.

    • mask = the first p bits as ones, the rest as zeros; wildcard = mask inverted
    • network = address AND mask; broadcast = network OR wildcard
    • addresses in the block = 2^(32 − p); usable hosts = 2^(32 − p) − 2 (p up to 30)
    • /31: two hosts (RFC 3021); /32: one host; split into /q: 2^(q − p) subnets

    All arithmetic uses unsigned 32-bit numbers. The Type line only recognises the RFC 1918 private blocks and the loopback range. Networks that reserve extra addresses (some cloud providers) will show fewer usable hosts than this tool does.

    Example: 192.168.1.130/26

    Which subnet is this address in?

    1. Mask/26 = 255.255.255.192; blocks of 64 addresses
    2. Network130 falls in the block starting at 128: 192.168.1.128
    3. Broadcast128 + 63 = 192.168.1.191
    4. Hosts192.168.1.129 to 192.168.1.190: 62

    192.168.1.128/26 with 62 usable hosts

    Split a /24 into /26 and you get four of these.

    Terms on this page

    CIDR
    Classless inter-domain routing: an address with a /prefix length.
    Subnet mask
    A 32-bit pattern of ones then zeros that marks the network part of an address.
    Broadcast address
    The last address in a subnet, used to reach every host on it.

    Common questions

    How many hosts are in a /24?

    256 addresses, 254 usable.

    What is a /27?

    A block of 32 addresses with 30 usable hosts and mask 255.255.255.224.

    What is a wildcard mask?

    The subnet mask inverted. It is used in some router access lists.

    Why are there two fewer usable addresses?

    The first is the network address and the last is the broadcast address.

    What about /31 and /32?

    A /31 has two usable addresses on a point-to-point link (RFC 3021), and a /32 is a single host.

    Does it work for IPv6?

    No, only IPv4.

    Is anything I enter sent to a server?

    No. The calculation happens in your browser and nothing you type leaves your device.

    Where these numbers come from

    Last verified 2026-10-25 The method on this page is checked against the sources above at least once a year. Spotted something out of date? Tell us and we will fix it.

    🧰 Developer and web tools

    Small developer and web jobs done in your browser. What you paste or choose is never sent anywhere.

    See all 24 tools in this section