Subnet Calculator for IPv4 & IPv6 CIDR Blocks

Compute network address, broadcast address, usable host range, and subnet mask for any IPv4 or IPv6 CIDR block.

IPv4's 32-bit address space and IPv6's 128-bit space are different enough in scale that a lot of subnet calculators only really handle one properly. This one does the arithmetic in BigInt rather than ordinary floating-point numbers, so the same code computes network boundaries whether you typed a 192.168.1.0/24 or a 2001:db8::/32, without ever running into IPv6's address totals exceeding what JavaScript's regular numbers can represent exactly.

How to use the subnet calculator

  1. Type an IPv4 or IPv6 address into the address field, for example 192.168.1.0 or 2001:db8:: — any host address inside the block works, because the network address is derived by masking it.
  2. Type the prefix length into its own CIDR prefix field: 0–32 for IPv4 or 0–128 for IPv6, without the slash.
  3. Read the results: network address, broadcast and subnet mask for IPv4, the usable or addressable range, total addresses, and the host count.
  4. To carve the block up, enter a power of two such as 4 or 16 in the split field and read the table of equal subnets.
  5. Copy the page URL to share the calculation; the address, prefix and split count are stored in it.

What you get for an IPv4 block

Enter an address and a prefix length and you get the network address, the dotted-decimal subnet mask, the broadcast address, the usable host range, the total address count, and the usable host count as separate figures. Blocks of /30 and larger exclude the network and broadcast addresses from the usable range; a /31 instead reports both of its addresses as usable, as RFC 3021 point-to-point links use them, and a /32 reports its single address as one usable host, rather than blindly subtracting two from every block.

The current address and prefix are kept in the page's own URL, so a specific subnet calculation can be bookmarked or pasted into a chat and the person on the other end sees the exact block you were looking at, not a blank form.

CIDR to subnet mask cheat sheet

How subnetting and CIDR notation work

An IPv4 address is 32 bits, and the prefix length says how many of the leading bits identify the network; the remaining bits number the hosts inside it. The subnet mask is that same split written as an address, with network bits set to 1 and host bits set to 0, so /24 becomes 255.255.255.0. Setting every host bit to 0 gives the network address, and setting every host bit to 1 gives the broadcast address.

Each bit you add to the prefix halves the block, which is why a /24 splits into two /25s or four /26s. IPv6 follows the same prefix arithmetic across 128 bits but is written only as address/prefix, with no dotted mask and no broadcast, which is why this calculator leaves those two fields out for IPv6 results.

IPv6 gets its own shape, not a stretched IPv4 view

IPv6 has no broadcast address at all — that concept doesn't exist in the protocol — so an IPv6 result correctly omits it rather than showing a meaningless placeholder. It still shows network address, first and last usable address, and total address count, but that total is displayed as a plain decimal string rather than a JavaScript number, since a /64 alone already holds more addresses than Number.MAX_SAFE_INTEGER can represent without rounding error.

Addresses are also displayed back in a compressed form, collapsing the longest run of two or more all-zero groups down to a double colon the way IPv6 addresses are conventionally written, rather than printing out eight full hex groups every time.

Splitting a block into smaller subnets

Given a block and a split count, the tool divides it into that many equal-sized subnets and lists each one's network address, usable range, and — for IPv4 — broadcast address. The split count has to be a power of two, since dividing an address block any other way doesn't produce subnets of equal size with clean boundaries, and it can't push the resulting prefix length past the address family's own bit width — you can't split a /30 IPv4 block into subnets smaller than individual addresses.

Address formats this parser won't accept

Questions people ask about Subnet/CIDR Calculator

Why doesn't my subnet show a broadcast address?
If you entered an IPv6 address, that's expected — IPv6 has no broadcast address concept at all, so the result correctly leaves that field out rather than fabricating one. Broadcast addresses only apply to IPv4 blocks, where they're shown alongside the network address and usable range.
Can this calculator handle addresses like ::ffff:192.168.1.1?
No — that IPv4-mapped IPv6 notation embeds a dotted-decimal tail inside an otherwise colon-separated address, and this parser expects a pure eight-group hex form once any :: compression is expanded. Convert the embedded IPv4 portion to its hex equivalent yourself, or use a dedicated dual-stack utility for that specific notation.
How many usable hosts are in a /30 versus a /24?
A /24 has 256 total addresses and 254 usable once the network and broadcast addresses are set aside. A /30 has 4 total addresses and 2 usable, because blocks of that size or larger always reserve those same two — enter either prefix here to see the counts computed from the bits.
Why does the split option only let me divide by powers of two?
Splitting a block into any other count wouldn't produce subnets of equal size with clean prefix boundaries — CIDR subnetting works by extending the prefix length by whole bits, and each additional bit exactly doubles the number of resulting subnets. A non-power-of-two split has no equivalent single-prefix representation, so it isn't offered.
Is 255.255.255.0 the same as /24?
Yes. 255.255.255.0 is twenty-four 1 bits followed by eight 0 bits, which is exactly what /24 means. This calculator takes the prefix number rather than a dotted mask, so type 24 in the prefix field and it displays 255.255.255.0 back as the subnet mask.
How many usable hosts are in a /31 or /32?
The calculator reports 2 usable hosts for a /31, following RFC 3021's point-to-point use where both addresses are assigned, and 1 for a /32, which describes a single host. The broadcast field still prints the block's last address for reference, but neither size reserves it.
Does IPv6 have a subnet mask?
Not in dotted form. IPv6 networks are written only as an address plus prefix length, such as 2001:db8::/48, so an IPv6 result here shows no mask and no broadcast field and counts every address in the block as addressable.
What is CIDR notation?
CIDR, short for Classless Inter-Domain Routing, writes a network as an address followed by a slash and the number of network bits, like 10.0.0.0/22. It replaced the fixed class A, B and C boundaries, so a block can be any power-of-two size.

Related tools on BrakeTools

Content reviewed 2026-09-27.