IP subnet calculator

SubnetKit is an IP subnet calculator: enter an IPv4 or IPv6 address with a prefix or mask to get the network, broadcast, usable host range, host count, subnet mask, wildcard, binary and its RFC block. All in your browser.

CIDR (192.0.2.0/24), address and mask (192.0.2.0 255.255.255.0), a bare address (read as /24) or IPv6 (2001:db8::/48). Arrow Up and Arrow Down move the prefix, and so does dragging the marker on the bit bar.

254 usable hosts, 192.0.2.1 to 192.0.2.254
A /24 splits the 32 address bits into 24 network bits and 8 host bits.
Documentation (TEST-NET-1, RFC 5737)
Network address192.0.2.0
Usable host range192.0.2.1 - 192.0.2.254
Broadcast address192.0.2.255
Usable hosts254
Subnet mask255.255.255.0
Wildcard mask0.0.0.255
CIDR notation192.0.2.0/24
Total addresses256
IP classC
RoleStandard LAN size
Prefix length/24

Usable in AWS / Azure: 251, GCP: 252Plan it with AWS reserved addresses

IP (binary)11000000.00000000.00000010.00000000
Mask (binary)11111111.11111111.11111111.00000000
Show the working192.0.2.0/24, step by step
/24: 24 network bits and 8 host bitsAddress 192.0.2.011000000000000000000001000000000192020Mask 255.255.255.0111111111111111111111111000000002552552550Network 192.0.2.011000000000000000000001000000000192020Broadcast 192.0.2.2551100000000000000000000101111111119202255/2424 network bits8 host bits
192.0.2.0/24: the first 24 bits are the network and the last 8 bits are hosts. Network 192.0.2.0, broadcast 192.0.2.255, 254 usable.
  1. Write the address in binary. Each of the four octets is 8 bits.

    11000000.00000000.00000010.00000000192.0.2.0
  2. Write the mask. /24 is 24 ones followed by 8 zeros.

    11111111.11111111.11111111.00000000255.255.255.0
  3. AND the address with the mask. A bit stays 1 only where both have a 1, so every host bit drops to 0. That is the network address.

    11000000.00000000.00000010.00000000192.0.2.0
    AND11111111.11111111.11111111.00000000255.255.255.0
    =11000000.00000000.00000010.00000000network 192.0.2.0
  4. Set all 8 host bits to 1. OR the network with the host bits. That is the broadcast address.

    11000000.00000000.00000010.00000000192.0.2.0
    OR00000000.00000000.00000000.111111110.0.0.255
    =11000000.00000000.00000010.11111111broadcast 192.0.2.255
  5. Count the hosts. 8 host bits give 2^8 = 256 addresses. The network and broadcast addresses are not hosts, so take 2 away.

    2^8 minus 2 = 254 usable, 192.0.2.1 to 192.0.2.254

  6. Check the special-purpose registry. 192.0.2.0/24 sits inside 192.0.2.0/24, Documentation (TEST-NET-1, RFC 5737).

Every number above comes from the same code as the calculator. How this is computed

Try:

Keyboard shortcuts

c
Copy the network in CIDR notation
a
Copy all values
s
Star or unstar the network
?
Show this overview
Arrow Up Arrow Down
In the address field: change the prefix by 1
/ or Ctrl K
Search the site
Esc
Close this overview

Single-key shortcuts only work while no text field has focus.

Networking calculators

All tools

Frequently asked questions

What is the usable host range?

It is every address in the block except the first, the network address, and the last, the broadcast address. For 192.0.2.0/24 that is 192.0.2.1 to 192.0.2.254, which is 254 usable hosts; a /30 has 2. A /31 point-to-point link uses both of its addresses (RFC 3021), so it has 2, and a /32 is a single host, so it has 1.

How many hosts are in a /24, /26, /27, /28, /29 and /30?

Usable hosts are the block size minus the network and broadcast addresses: a /24 (255.255.255.0) has 254, a /26 (255.255.255.192) has 62, a /27 (255.255.255.224) has 30, a /28 (255.255.255.240) has 14, a /29 (255.255.255.248) has 6 and a /30 (255.255.255.252) has 2. The CIDR cheat sheet lists all 33 prefixes from /0 to /32.

Subnet mask and usable hosts for common IPv4 prefixes
PrefixSubnet maskUsable hosts
/24255.255.255.0254
/26255.255.255.19262
/27255.255.255.22430
/28255.255.255.24014
/29255.255.255.2486
/30255.255.255.2522

All 33 prefixes in the CIDR cheat sheet

What does a subnet calculator do?

It takes an IP address and a prefix or mask, then works out the network address, broadcast address, usable host range, host count, subnet mask, wildcard mask and binary form. SubnetKit does all of this instantly in your browser, for IPv4 and for IPv6.

How do I calculate a subnet?

Enter the IP with its prefix, such as 192.0.2.0/24, or an IP with a dotted mask, such as 192.0.2.0 255.255.255.0. The calculator reads off the network, first and last usable host, broadcast and total addresses as you type. Arrow Up and Arrow Down in the field, or the minus and plus buttons next to it, change the prefix by one.

Does it work with IPv6?

Yes. Type an IPv6 network such as 2001:db8::/48 into the same field. You get the network, the first and last address, the prefix, the number of addresses and the number of /64 subnets, which is 65,536 for a /48. IPv6 has no broadcast address, so every address in the block is usable.

Can it split a network into smaller subnets?

Yes. The Plan tab splits a block into equal subnets or sizes each one by host count (VLSM), and exports the plan as CSV, Markdown, JSON or Terraform. The Batch tab checks a whole list of ranges at once for overlaps, gaps and the smallest set of CIDR blocks that covers them.

Is SubnetKit free?

Yes. Every calculator and reference page is free with no sign up and no limits. Nothing you type is uploaded, because the maths runs entirely on your device.

Why SubnetKit

Most subnet calculators reload the page when you submit, bury the result under ads, or make you pick IPv4 or IPv6 first. SubnetKit takes either in one field, shows everything at once and recomputes on every keystroke. It is built for people who reach for a subnet calculator ten times a day and want it to get out of the way.

Because all the maths is plain JavaScript running in your browser, nothing you type is ever sent to a server. That also makes it fast: there is no round trip, so results appear the instant you type. Pair it with the CIDR reference for the full prefix table, or the IPv6 subnet calculator for the expanded form and more IPv6 detail.

Do this from the terminal

The same reference data is a keyless JSON endpoint, and there are good local tools that need no network at all.

curl -s https://subnetkit.dev/api/cidr/24.json | jq

# or locally, with no network at all:
ipcalc 192.0.2.0/24
sipcalc 192.0.2.0/24

ipcalc ships in most Linux distributions and sipcalc handles IPv4 and IPv6. Both give the same network, broadcast and host range this page does.

The SubnetKit API is the one to reach for in a build step or a script. It has no key and no rate limit, and the full schema is in the OpenAPI document.