↑↓ to move ↵ to open Esc to close Browse all tools

Subnet Calculator

Type an IP address with a prefix or netmask to see its network, broadcast address, usable host range and masks, then split the network into subnets. Works for IPv4 and IPv6.

IP address

IPv4
Like 192.168.1.10/24, 10.0.0.5 255.255.0.0 or 2001:db8::1/64.
Network
192.168.1.0/24
Usable hosts
254
Broadcast
192.168.1.255
Host range
192.168.1.1 to 192.168.1.254
Netmask
255.255.255.0

Private (RFC 1918)

    Examples

    All details

    Split into subnets

    Binary view

    Network bits are dark, host bits are gray.

    Address type

      Checked against the IANA special-purpose address registries (October 2025) and the multicast blocks of RFC 5771.

      Runs on your device. Nothing you enter is sent to a server.

      What the subnet calculator shows

      An IPv4 address is 32 bits, written as four numbers from 0 to 255. In CIDR notation, the prefix length after the slash says how many of those bits name the network; the rest number the hosts inside it. 192.168.1.10/24 means the first 24 bits, 192.168.1, are the network and the last 8 bits pick one of its hosts. The netmask writes the same split as an address: 24 ones followed by 8 zeros is 255.255.255.0. The number base converter shows any of these numbers in binary.

      The calculator applies the mask to your address. Setting every host bit to 0 gives the network address, setting every host bit to 1 gives the broadcast address, and everything in between is the usable host range you can give to computers, printers and routers. The wildcard mask is the netmask with each bit flipped, which is how Cisco access lists write the same range.

      usable hosts = 2(32 - prefix) - 2

      For a /26 that is 26 - 2 = 62 hosts. The two that are subtracted are the network and broadcast addresses.

      The /31 and /32 exceptions

      The minus 2 does not work for the two longest prefixes. RFC 3021 allows a /31 on a point-to-point link, such as a link between two routers, and says that both of its addresses are hosts, since such a link needs no network or broadcast address. A /32 is one single address, which RFC 4632 calls a host route. The calculator shows 2 and 1 usable hosts for them and no broadcast address. When you plan subnets by host count, it uses /30 for links by default; tick the RFC 3021 option to get /31 and /32 instead.

      CIDR cheat sheet

      Every IPv4 prefix length with its netmask, wildcard mask, number of addresses and usable hosts. Each step up the table halves the size of the network. The old class C network is a /24, class B a /16 and class A a /8.

      PrefixNetmaskWildcardAddressesUsable hosts
      /32255.255.255.2550.0.0.011
      /31255.255.255.2540.0.0.122
      /30255.255.255.2520.0.0.342
      /29255.255.255.2480.0.0.786
      /28255.255.255.2400.0.0.151614
      /27255.255.255.2240.0.0.313230
      /26255.255.255.1920.0.0.636462
      /25255.255.255.1280.0.0.127128126
      /24255.255.255.00.0.0.255256254
      /23255.255.254.00.0.1.255512510
      /22255.255.252.00.0.3.2551,0241,022
      /21255.255.248.00.0.7.2552,0482,046
      /20255.255.240.00.0.15.2554,0964,094
      /19255.255.224.00.0.31.2558,1928,190
      /18255.255.192.00.0.63.25516,38416,382
      /17255.255.128.00.0.127.25532,76832,766
      /16255.255.0.00.0.255.25565,53665,534
      /15255.254.0.00.1.255.255131,072131,070
      /14255.252.0.00.3.255.255262,144262,142
      /13255.248.0.00.7.255.255524,288524,286
      /12255.240.0.00.15.255.2551,048,5761,048,574
      /11255.224.0.00.31.255.2552,097,1522,097,150
      /10255.192.0.00.63.255.2554,194,3044,194,302
      /9255.128.0.00.127.255.2558,388,6088,388,606
      /8255.0.0.00.255.255.25516,777,21616,777,214
      /7254.0.0.01.255.255.25533,554,43233,554,430
      /6252.0.0.03.255.255.25567,108,86467,108,862
      /5248.0.0.07.255.255.255134,217,728134,217,726
      /4240.0.0.015.255.255.255268,435,456268,435,454
      /3224.0.0.031.255.255.255536,870,912536,870,910
      /2192.0.0.063.255.255.2551,073,741,8241,073,741,822
      /1128.0.0.0127.255.255.2552,147,483,6482,147,483,646
      /00.0.0.0255.255.255.2554,294,967,2964,294,967,294

      Private, shared and special IPv4 ranges

      Some ranges are set aside for a purpose and never appear on the public internet. The calculator checks every address against the IANA special-purpose registry and shows each block it belongs to, with the RFC that defines it. The ones you meet most often:

      BlockPurposeDefined in
      10.0.0.0/8Private networksRFC 1918
      172.16.0.0/12Private networks (172.16.0.0 to 172.31.255.255)RFC 1918
      192.168.0.0/16Private networksRFC 1918
      100.64.0.0/10Shared address space for carrier-grade NAT at internet providersRFC 6598
      127.0.0.0/8Loopback: the device itselfRFC 1122
      169.254.0.0/16Link-local: self-assigned when no address configuration is available, such as a missing DHCP serverRFC 3927
      192.0.2.0/24, 198.51.100.0/24, 203.0.113.0/24Documentation and examples (TEST-NET-1 to 3)RFC 5737
      198.18.0.0/15Network benchmarkingRFC 2544
      224.0.0.0/4MulticastRFC 5771
      240.0.0.0/4ReservedRFC 1112
      255.255.255.255/32Limited broadcastRFC 919

      Address classes A to E (historic)

      Before CIDR arrived in 1993 with RFC 1519, the first bits of an address fixed the size of its network, as RFC 791 and RFC 1112 defined. RFC 4632, the current CIDR document, points out that a mask can no longer be inferred from the first bits, so the class is shown only as background.

      ClassFirst octetLeading bitsOld default mask
      A0 to 1270255.0.0.0 (/8)
      B128 to 19110255.255.0.0 (/16)
      C192 to 223110255.255.255.0 (/24)
      D224 to 2391110Multicast
      E240 to 2551111Reserved

      Splitting a network: equal subnets and VLSM

      Each bit you add to the prefix doubles the number of subnets and halves their size. Splitting 192.168.1.0/24 into 4 subnets takes 2 bits, which gives four /26 networks of 62 hosts each, starting at .0, .64, .128 and .192. A count that is not a power of two is rounded up: 5 subnets need 3 bits and give 8 subnets of /27, so you keep 3 in reserve. In Hosts mode you enter how many devices each subnet needs and get the smallest prefix that fits, and in Prefix mode you pick the new prefix length directly.

      When the subnets need different sizes, VLSM (variable length subnet masking) saves addresses. The calculator sorts the needs from largest to smallest and places each subnet on a boundary of its own size, so none overlap. The default plan in the tool shows how this works inside 192.168.1.0/24:

      SubnetHosts neededNetworkUsable hosts
      Sales100192.168.1.0/25126
      Office50192.168.1.128/2662
      Lab20192.168.1.192/2730
      Router link2192.168.1.224/302

      The rest of the range, 192.168.1.228/30, 192.168.1.232/29 and 192.168.1.240/28, stays free for later, and the table lists it as unused.

      IPv6 prefixes and notation

      An IPv6 address has 128 bits, written as eight groups of four hex digits. RFC 4291 requires 64-bit interface identifiers for almost all unicast addresses, so a single network segment is a /64, and a larger prefix such as a /48 is divided into /64 networks. IPv6 has no broadcast address, which is why the calculator shows the first and last address of the prefix instead of a host range. The numbers get large: a /64 holds 18,446,744,073,709,551,616 addresses, and the calculator counts them exactly instead of rounding.

      RFC 5952 sets one canonical short form. Hex letters are lowercase, leading zeros in a group are dropped, and the longest run of two or more zero groups becomes a double colon, the first one if two runs are equally long. A single zero group stays as 0. The calculator shows both this compressed form and the full expanded form with all 32 digits, and it accepts either as input, including a zone index like %eth0 and a dotted IPv4 part at the end. Common special ranges are ::1 for loopback, fe80::/10 for link-local, fc00::/7 for unique local addresses, 2001:db8::/32 and 3fff::/20 for documentation, ff00::/8 for multicast and 2000::/3 for global unicast.

      How to use the subnet calculator

      1. 1Type an IP address with a prefix like /24 or a netmask like 255.255.255.0, or pick the prefix from the list. IPv6 addresses are detected automatically.
      2. 2Read the network, broadcast address, host range and number of hosts at the top, and every other value with a copy button under All details.
      3. 3To plan subnets, choose Count, Hosts, Prefix or VLSM under Split into subnets, then copy the table or a link to the whole plan.

      Frequently asked questions

      How many usable hosts does a /24 have?

      254. A /24 holds 256 addresses. The first one is the network address and the last one is the broadcast address, and neither can be given to a device. In general a prefix of length n holds 2 to the power of (32 minus n) addresses, and you subtract 2 for the usable hosts. The exceptions are /31 with 2 hosts and /32 with 1.

      Why does a /31 have two usable hosts?

      RFC 3021 allows a /31 on a point-to-point link, such as a link between two routers, and treats both of its addresses as hosts, since such a link needs no network or broadcast address. That uses 2 addresses instead of the 4 of a /30. A /32 is a single address, which RFC 4632 lists as a host route.

      What is the difference between a netmask and a wildcard mask?

      A wildcard mask is the netmask with every bit flipped: 255.255.255.0 becomes 0.0.0.255. Cisco access lists use wildcard masks, where a 0 bit must match and a 1 bit may be anything. The calculator shows both, and you can also type a wildcard mask after the address; it is recognized and converted.

      Which IP addresses are private?

      RFC 1918 sets aside 10.0.0.0/8, 172.16.0.0/12 (172.16.0.0 to 172.31.255.255) and 192.168.0.0/16 for private networks. 100.64.0.0/10 is shared address space from RFC 6598, meant for internet providers that run carrier-grade NAT, not for home or office networks. None of these blocks is reachable from the internet.

      How do I split a network into equal subnets?

      Every extra prefix bit doubles the number of subnets and halves their size. To split 192.168.1.0/24 into 4 subnets, add 2 bits: you get four /26 networks with 62 hosts each, starting at .0, .64, .128 and .192. If the count is not a power of two, round up: 5 subnets need 3 bits, which gives 8 subnets of /27.

      How is an IPv6 address shortened?

      RFC 5952 sets the rules: write hex letters in lowercase, drop leading zeros in each group, and replace the longest run of two or more all-zero groups with a double colon (the first run if two are equally long). A single zero group stays as 0. So 2001:0db8:0000:0000:0000:ff00:0042:8329 becomes 2001:db8::ff00:42:8329.

      Does the calculator send my IP address anywhere?

      No. All the math runs in your browser, and nothing you type leaves your device. The calculator also does not look up your own IP address; it only works with the addresses you enter.