Navid MoazzezNavid Moazzez

Free Subnet Calculator (+ Guide)

A free subnet calculator for IPv4 and IPv6 that shows the network, broadcast, hosts and mask, bit by bit.

Navid Moazzezby Navid Moazzez·Updated Oct 3, 2026·4 min read·
1

Your numbers

2

Your result

Rate this tool

Embed this tool on your site

Paste the code into any page: WordPress, Webflow, Squarespace, Ghost or plain HTML. It's free with the credit under it, which links back to navid.me.

Theme
Background
Corners
Font

This free subnet calculator works out any IPv4 or IPv6 subnet: the network address, broadcast, host range, mask and wildcard, with every bit drawn out.

Type an address with a prefix or a mask, or move the slider, then split the block into smaller ones or find the prefix for the hosts you need.

I built it because subnetting is binary arithmetic that's easy to get wrong by one, and seeing the bits makes the answer obvious.

Here's how subnets work, what the special ranges are for, and a worked example.

key_takeaways.mdTL;DR

Key takeaways

A /n prefix keeps the first n bits as the network, so a block holds 2 to the power of (32 − n) IPv4 addresses, as CIDR (RFC 4632) defines it.
A normal subnet loses 2 addresses, the network and the broadcast, so a /24 has 256 addresses and 254 hosts.
A /31 is made for point-to-point links: both addresses are hosts and there's no broadcast (RFC 3021).
The private ranges are 10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16 (RFC 1918).

What is a subnet calculator?

A subnet calculator turns an IP address and a prefix into the block it belongs to: where it starts and ends, and how many devices it can number.

This one works for IPv4 and IPv6, splits a block into smaller ones and finds the prefix for a number of hosts.

How it works

Everything is worked out in your browser, from the address you type.

Work out a subnet0/4

Prefixes and masks

RFC 4632 replaced the old network classes with prefixes. In 172.16.0.0/16, the /16 means the first 16 bits are the network and the other 16 number the hosts, the same as the mask 255.255.0.0.

A prefix can describe any power-of-two block, from 1 address to all 2^32 IPv4 addresses. These are the common ones.

/8
Mask
255.0.0.0
Addresses
16,777,216
Usable hosts
16,777,214
/16
Mask
255.255.0.0
Addresses
65,536
Usable hosts
65,534
/20
Mask
255.255.240.0
Addresses
4,096
Usable hosts
4,094
/22
Mask
255.255.252.0
Addresses
1,024
Usable hosts
1,022
/23
Mask
255.255.254.0
Addresses
512
Usable hosts
510
/24
Mask
255.255.255.0
Addresses
256
Usable hosts
254
/25
Mask
255.255.255.128
Addresses
128
Usable hosts
126
/26
Mask
255.255.255.192
Addresses
64
Usable hosts
62
/27
Mask
255.255.255.224
Addresses
32
Usable hosts
30
/28
Mask
255.255.255.240
Addresses
16
Usable hosts
14
/29
Mask
255.255.255.248
Addresses
8
Usable hosts
6
/30
Mask
255.255.255.252
Addresses
4
Usable hosts
2
/31
Mask
255.255.255.254
Addresses
2
Usable hosts
2
/32
Mask
255.255.255.255
Addresses
1
Usable hosts
1

The usable hosts are the addresses minus the network and the broadcast. As RFC 3021 puts it, a /30 "requires four addresses per link": two hosts, one all-zeros network and one all-ones broadcast.

/31 and /32

A /31 has only 2 addresses. RFC 3021 lets point-to-point links use them both as hosts, since a link between two routers has two ends and no broadcast.

A /32 is one address, used for a single host route or a loopback.

Private and special addresses

RFC 1918 sets aside three private ranges for networks that don't route on the internet, and IANA's special-purpose registry lists the rest.

  • Private: 10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16
  • Shared address space: 100.64.0.0/10, for carrier-grade NAT (RFC 6598)
  • Loopback: 127.0.0.0/8, the machine itself
  • Link local: 169.254.0.0/16, self-assigned when no server answers (RFC 3927)
  • Documentation: 192.0.2.0/24, 198.51.100.0/24 and 203.0.113.0/24, for examples like the ones on this page (RFC 5737)
  • Multicast: 224.0.0.0 to 239.255.255.255 (RFC 5771)

The calculator names the range for every address you type.

IPv6 subnets

An IPv6 address is 128 bits, written as 8 groups of 4 hex digits, RFC 4291 says. Unicast interface IDs are 64 bits long, so a subnet is a /64, and a /48 holds 65,536 of them.

The calculator writes addresses the way RFC 5952 asks: lowercase, no leading zeros, and :: for the longest run of zero groups.

A worked example

Here's the example the calculator loads: 192.168.10.130/26.

A /26 keeps 26 network bits and leaves 6 host bits, so the block has 64 addresses.

130 falls in the block from 192.168.10.128 to 192.168.10.191. The network is .128, the broadcast .191, and the 62 hosts run from .129 to .190.

Split into /28 blocks, it makes 4 subnets of 16 addresses and 14 hosts each. For 50 hosts, a /26 is the smallest that fits, with 62.

Mistakes to avoid

These are the slips that come up most.

  • Counting every address as a host, when the network and broadcast are taken on a normal subnet
  • Typing a mask with gaps, such as 255.0.255.0, which isn't a valid prefix
  • Using a documentation range, such as 192.0.2.0/24, on a real network

Who is the subnet calculator for?

It's for network admins, students studying for networking exams and anyone setting up a home or office network, and these tools help around it.

Draw the bits once, and the subnet answers itself.

Plan your money with your AI

Take your numbers further in

Subnet Calculator FAQs

Questions about the subnet calculator? Here's what to know.

A subnet calculator turns an IP address and a prefix into its network, broadcast, host range and mask.

256 addresses, minus the network and the broadcast, so 254 hosts.

Take 2 to the power of the host bits, then subtract 2.

A /26 has 6 host bits: 64 − 2 = 62 hosts.

255.255.255.192, with a wildcard mask of 0.0.0.63.

RFC 3021 lets point-to-point links use both addresses, since a link has two ends and no broadcast.

10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16, under RFC 1918.

The mask with its bits flipped, such as 0.0.0.255 for 255.255.255.0.

Router access lists use it.

Yes, type an IPv6 address with a prefix, such as 2001:db8::/48.

It shows the range, the number of addresses and the /64 networks.

RFC 4291 makes unicast interface IDs 64 bits long, which leaves the first 64 bits for the network.

No, the calculator works it out on your device.

Yes, it's free with no sign-up.

It runs in your browser, and your numbers stay on your device.

I did.

I'm Navid Moazzez, and I made the subnet calculator as one of my free tools on navid.me.

More about me.

Navid Moazzez

AI business strategist & AI OS builder

Navid Moazzez helps creators and founders master AI and build their own AI Operating System (AI OS) to automate their business and life.

Navid.me is reader-supported. When you buy through links on this site, I may earn an affiliate commission. Read the affiliate disclaimer.

Related calculators

More free tools

Related MCP servers & CLIs

Free AI newsletter

The most actionable AI newsletter for founders

Every week, get proven AI strategies, curated tools, and step-by-step systems to grow your audience, create better content, and build a profitable creator business.

No fluff, no filler, no BS. Just five minutes each week that might level up your online business and life.

P.S. Sign up now to get free access to my ultimate AI tools guide for creators.

Loved by 10,000+ readers
Loved by 10,000+ readers