Back

IPv4/IPv6 Subnet Calculator

Calculate IPv4 and IPv6 network boundaries, address ranges, and subnet sizes, and see whether a range is private, CGNAT or public.

/

Results

Network Address

192.168.1.0

Address type:PrivateRFC 1918

Used inside home and office networks. The internet can't reach it without NAT or port forwarding.

Broadcast Address

192.168.1.255

Usable Host Range

192.168.1.1 - 192.168.1.254

Total Usable Hosts

254

Subnet Mask

255.255.255.0

Binary Subnet Mask

11111111.11111111.11111111.00000000

Interactive Bit-Level Visualizer

Click any bit to flip it and instantly update the IP address. The small number under each bit is its place value. Network bits are indigo, host bits are fuchsia.

How to use this tool

  1. Enter the IP address

    Type an IPv4 address such as 192.168.1.1 or an IPv6 address such as 2001:db8::1. IPv4 octets must use canonical decimal notation without leading zeros, while IPv6 also accepts IPv4-mapped dotted tails such as ::ffff:192.0.2.128.

  2. Set the CIDR prefix

    Enter the prefix length after a slash, like /24 for IPv4 or /64 for IPv6. The prefix defines how many bits belong to the network versus the host.

  3. Read the subnet boundaries

    For IPv4, the calculator shows the network address, broadcast address, and usable host range. For IPv6, it shows the first and last addresses in the range because IPv6 uses multicast instead of broadcast.

  4. Check the usable host count

    For IPv4, the usual host count excludes the network and broadcast addresses, so a /24 gives 254 usable hosts. For IPv6, the calculator reports the full address count of 2 raised to the number of host bits, so a /126 contains 4 addresses.

About this tool

The Subnet Calculator takes any IPv4 or IPv6 address and a CIDR prefix (like /24 or /64) and works out the exact boundaries of that network segment. Network engineers, sysadmins, and IT students can use it to check their math.

Use it when you're setting up a home lab, configuring AWS VPCs, or studying for the CCNA. You get IPv4 network and broadcast details plus IPv6 address boundaries without doing the binary math by hand.

How it works

The calculator converts an IP address into its raw binary representation. A bitwise AND with the subnet mask finds the first address, while setting every host bit finds the last address. In IPv4 that last value is the broadcast address. IPv6 has no broadcast address, so it is shown only as the end of the address range.

IPv6 Support

IPv6 subnetting follows the same math as IPv4 but uses 128-bit addresses instead of 32-bit. Because the numbers are too large for regular JavaScript numbers, the calculator uses native BigInt math to compute IPv6 network boundaries and host counts up to /128.

Private, CGNAT and other address types

Next to the network address, the calculator labels the kind of block it sits in, from the IANA special purpose registries. That covers the RFC 1918 private ranges, carrier grade NAT (100.64.0.0/10), loopback, link local, documentation, multicast and reserved space, plus unique local (fc00::/7) and the other special IPv6 blocks. It checks the whole network, not only the address you typed. 172.0.0.0/8 holds public addresses and the private 172.16.0.0/12, so it shows as mixed and names both.

From addresses to names

A subnet plan hands out addresses, and DNS gives them names. A records point names at IPv4 addresses and AAAA records at IPv6 ones. To check that a name lands inside the block you planned, look it up in the DNS Lookup, which shows what Cloudflare and Google return for it side by side.

Popular subnet scenarios

Pre-computed address counts and use cases for common IPv4 and IPv6 prefixes.

Protocol comparisons for the addressing concepts this calculator covers, such as IPv4 vs IPv6.

Frequently asked questions

What is a Subnet Mask or CIDR?
A subnet mask defines which part of an IP address is the network and which part is the host. CIDR (Classless Inter-Domain Routing) is a shorthand for the subnet mask. For example, a /24 CIDR means the first 24 bits of the IP address are the network, leaving the last 8 bits for hosts.
How many usable IP addresses are in a /24 subnet?
A /24 subnet provides 256 total IP addresses, but 2 are reserved: the network address (first IP) and the broadcast address (last IP). This leaves 254 usable host addresses for devices like computers, phones, and printers.
What is the difference between IPv4 and IPv6?
IPv4 uses 32-bit addresses (e.g., 192.168.1.1), providing roughly 4.3 billion unique addresses. IPv6 uses 128-bit addresses (e.g., 2001:0db8::1), providing about 340 undecillion addresses to solve the IPv4 address exhaustion problem.
Is 172.20.x.x a private address?
Yes. The private block 172.16.0.0/12 runs from 172.16.0.0 to 172.31.255.255, so every 172.20.x.x address is private. Addresses just outside it, like 172.15.x.x and 172.32.x.x, are public. RFC 1918 sets aside two other private blocks: 10.0.0.0/8 and 192.168.0.0/16. Type any address into the calculator and the label next to the network address shows which kind of block it's in.
Why does my IP address start with 100.64?
Your ISP most likely uses carrier grade NAT (CGNAT). The block 100.64.0.0/10, from 100.64.0.0 to 100.127.255.255, is shared address space from RFC 6598. The ISP gives your router an address from it and shares one public address between many customers. So if your router's WAN address is in this block, port forwarding from the internet won't reach you. To host a game server or reach your home from outside, ask your ISP for a public IPv4 address, use IPv6, or use a tunnel service. VPNs like Tailscale also hand out addresses from this block, so check which network adapter has it.
What is a broadcast address?
The broadcast address is the last IP address in an IPv4 subnet. It's used to send data to all devices on that network segment at once. IPv6 has no broadcast addresses and uses multicast instead.

Use this tool on your own site

Drop the Subnet Calculator into your blog, docs, or CMS with one iframe snippet. Free, no signup. See all embeddable tools