Skip to main content
ponderloop

IP Subnet Calculator for IPv4 CIDR and IPv6

192.168.1.10/24 is in the network 192.168.1.0/24: the broadcast address is 192.168.1.255, the usable hosts run from 192.168.1.1 to 192.168.1.254 (254 hosts), the netmask is 255.255.255.0 and the wildcard mask is 0.0.0.255. Type any IPv4 address with a prefix (192.168.1.10/24) or a dotted mask (192.168.1.10 255.255.255.0) to get the same for your network, plus its binary form, address class and type, and a list of equal subnets. Type an IPv6 address to get its shortest RFC 5952 form, its full form, the prefix range and how many /64 networks it holds.

Updated Runs in your browser: nothing you enter is uploadedHow this tool works

IPv4 like 192.168.1.10/24 or 192.168.1.10 255.255.255.0, or IPv6 like 2001:db8::1/64. Splitting works for IPv4.

Result

192.168.1.0/24: 256 addresses, 254 usable hosts.

Network

CIDR notation
192.168.1.0/24
Network address
192.168.1.0
Broadcast address
192.168.1.255
First usable host
192.168.1.1
Last usable host
192.168.1.254
Total addresses
256
Usable hosts
254

Masks

Netmask
255.255.255.0
Wildcard mask
0.0.0.255
Prefix length
/24

Address type

Private network space, not routed on the public internet.

Address entered
192.168.1.10
Address class
Class C (historical, pre-CIDR)
Address type
Private (RFC 1918)

Binary

The first 24 bits are the network part (bold); the other 8 are the host part.

Address
11000000.10101000.00000001.00001010
Netmask
11111111.11111111.11111111.00000000
Network
11000000.10101000.00000001.00000000
Broadcast
11000000.10101000.00000001.11111111

4 subnets of /26

Each has 62 usable hosts.

SubnetUsable hostsBroadcast
192.168.1.0/26192.168.1.1 to 192.168.1.62192.168.1.63
192.168.1.64/26192.168.1.65 to 192.168.1.126192.168.1.127
192.168.1.128/26192.168.1.129 to 192.168.1.190192.168.1.191
192.168.1.192/26192.168.1.193 to 192.168.1.254192.168.1.255

IPv4 prefix lengths, masks and host counts

Usable hosts are the total minus the network and broadcast addresses; /31 and /32 are special cases (RFC 3021).
PrefixNetmaskWildcardTotal addressesUsable hosts
/8255.0.0.00.255.255.25516,777,21616,777,214
/16255.255.0.00.0.255.25565,53665,534
/20255.255.240.00.0.15.2554,0964,094
/22255.255.252.00.0.3.2551,0241,022
/23255.255.254.00.0.1.255512510
/24255.255.255.00.0.0.255256254
/25255.255.255.1280.0.0.127128126
/26255.255.255.1920.0.0.636462
/27255.255.255.2240.0.0.313230
/28255.255.255.2400.0.0.151614
/29255.255.255.2480.0.0.786
/30255.255.255.2520.0.0.342
/31255.255.255.2540.0.0.122
/32255.255.255.2550.0.0.011

Special IPv4 address ranges

The address type the calculator reports, from the IANA special-purpose registry (RFC 6890) and the RFCs that define each range.
RangeTypeDefined in
255.255.255.255/32Limited broadcastRFC 919
0.0.0.0/8This networkRFC 1122
10.0.0.0/8PrivateRFC 1918
100.64.0.0/10Carrier-grade NAT (shared address space)RFC 6598
127.0.0.0/8LoopbackRFC 1122
169.254.0.0/16Link-localRFC 3927
172.16.0.0/12PrivateRFC 1918
192.0.0.0/24IETF protocol assignmentsRFC 6890
192.0.2.0/24Documentation (TEST-NET-1)RFC 5737
192.168.0.0/16PrivateRFC 1918
198.18.0.0/15BenchmarkingRFC 2544
198.51.100.0/24Documentation (TEST-NET-2)RFC 5737
203.0.113.0/24Documentation (TEST-NET-3)RFC 5737
224.0.0.0/4MulticastRFC 5771
240.0.0.0/4Reserved for future useRFC 1112

IPv6 address types

The most specific range that holds the address decides its type; anything outside 2000::/3 and these ranges is reserved or unassigned.
PrefixTypeDefined in
::/128Unspecified addressRFC 4291
::1/128LoopbackRFC 4291
::ffff:0:0/96IPv4-mapped addressRFC 4291
64:ff9b::/96IPv4/IPv6 translation (NAT64)RFC 6052
100::/64Discard-onlyRFC 6666
2001::/32Teredo tunnellingRFC 4380
2001:db8::/32DocumentationRFC 3849
2002::/166to4 tunnellingRFC 3056
3fff::/20DocumentationRFC 9637
fc00::/7Unique local address (ULA)RFC 4193
fe80::/10Link-local unicastRFC 4291
fec0::/10Site-local (deprecated)RFC 3879
ff00::/8MulticastRFC 4291
2000::/3Global unicastRFC 4291

Common IPv6 prefix sizes

A /64 is the standard size of one subnet; sites usually get a /48 or /56 to split into /64s.
PrefixAddresses/64 networks insideTypical use
/3279,228,162,514,264,337,593,543,950,336 (2^96)4,294,967,296 (2^32)An internet provider’s allocation
/481,208,925,819,614,629,174,706,176 (2^80)65,536A site or organization
/564,722,366,482,869,645,213,696 (2^72)256A home or small office
/6418,446,744,073,709,551,616 (2^64)1One subnet (one LAN)
/1272less than 1A point-to-point link (RFC 6164)
/1281less than 1A single address

How to calculate a subnet

  1. Write the address with its prefix. Type the IPv4 address followed by a slash and the prefix length, like 192.168.1.10/24, or follow the address with a dotted netmask like 255.255.255.0. The prefix is how many leading bits name the network.
  2. Find the network and broadcast addresses. Keep the network bits and set the host bits to 0 for the network address (192.168.1.0), or to 1 for the broadcast address (192.168.1.255).
  3. Count the usable hosts. A /24 leaves 8 host bits, so 2^8 = 256 addresses. Take away the network and broadcast addresses and 254 are left for hosts, from 192.168.1.1 to 192.168.1.254. A /31 keeps both of its 2 addresses and a /32 is one host.
  4. Split into smaller subnets. Each extra prefix bit halves the block. Choose how many subnets you need (a power of 2) or the prefix you want: 192.168.1.0/24 into 4 subnets gives 192.168.1.0/26, 192.168.1.64/26, 192.168.1.128/26, 192.168.1.192/26.
  5. Check the address type. The calculator names private, carrier-grade NAT, loopback, link-local, multicast and documentation ranges, so you can see at once whether an address is meant to be routed on the internet.

Frequently asked questions

How do I calculate the network address from an IP address and prefix?
Write the address in binary and set every host bit (the bits after the prefix) to 0. For 192.168.1.10/24 the first 24 bits are the network, so the network address is 192.168.1.0. In decimal terms, round the address down to a multiple of the block size: a /24 block is 256 addresses long.
How many usable hosts are in a /24, /26 or /30?
A /24 has 254 usable hosts, a /26 has 62 and a /30 has 2. The formula is 2^(32 − prefix) − 2: the two taken away are the network address and the broadcast address.
How are /31 and /32 networks counted?
A /31 has 2 addresses and both are usable: RFC 3021 lets point-to-point links drop the network and broadcast addresses, so a router link needs 2 addresses instead of 4. A /32 is a single host address with 1 usable host and no broadcast. The calculator shows both exactly this way.
What is a wildcard mask?
The wildcard mask is the netmask with every bit flipped: 255.255.255.0 becomes 0.0.0.255. Router access lists (such as Cisco ACLs) use it to say which address bits may differ. Its 1 bits mark host bits, the 0 bits must match.
Which IPv4 ranges are private?
RFC 1918 reserves 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. RFC 6598 adds 100.64.0.0/10 for carrier-grade NAT, which is not private in the same sense: it is shared between a provider and its customers. 169.254.0.0/16 is link-local (RFC 3927), 127.0.0.0/8 is loopback, and 192.0.2.0/24, 198.51.100.0/24 and 203.0.113.0/24 are for documentation (RFC 5737).
Can I split a network into subnets of different sizes?
This tool splits into equal subnets: either a number of them (which must be a power of 2, because each extra prefix bit doubles the count) or a prefix length. For unequal sizes (VLSM), split the block once, then split one of the resulting subnets again. The list is capped at 256 subnets; the heading always shows the true total.
How does IPv6 shorten an address?
RFC 5952 sets one canonical form: lowercase hex, no leading zeros in a group, and “::” in place of the longest run of two or more all-zero groups (the first one if there is a tie). 2001:0db8:0000:0000:0000:0000:0000:0001 becomes 2001:db8::1. A single zero group is not replaced: 2001:db8:0:1:1:1:1:1 stays 2001:db8:0:1:1:1:1:1. In 2001:db8:0:0:1:0:0:1 the two runs are equally long, so the first is shortened: 2001:db8::1:0:0:1.
How many /64 networks are in an IPv6 prefix?
A /64 is the standard size of one subnet, so a prefix of length p up to /64 holds 2^(64 − p) of them: a /48 holds 65,536 and a /56 holds 256. A prefix longer than /64, such as a /127 link, is smaller than one /64.
What kinds of IPv6 address does it recognise?
Unique local addresses (fc00::/7, RFC 4193), link-local (fe80::/10), documentation (2001:db8::/32, RFC 3849), multicast (ff00::/8), loopback (::1), the unspecified address (::), IPv4-mapped addresses (::ffff:0:0/96) and global unicast (2000::/3). The table above lists them all.
Is anything I type sent to a server?
No. The address is worked out in your browser with plain arithmetic (BigInt for IPv6) and never leaves your device.

How it works

An IPv4 address is read as four decimal parts (0 to 255, no leading zeros, which some systems read as octal) into one number below 2^32. The prefix, or a dotted mask whose 1 bits are all on the left, gives a block of 2^(32 − prefix) addresses. The network address is the typed address rounded down to a multiple of the block size and the broadcast address is the last address of the block; the usable range excludes both, except for /31 (both addresses are hosts, RFC 3021) and /32 (one host). The wildcard mask is 2^32 − 1 minus the netmask. Address class (A to E) is the historical rule from the first bits and is shown for reference only, since CIDR (RFC 4632) replaced classes; address type is the first match in the special-purpose ranges listed above. A bare address with no prefix is treated as /32 (IPv4) or /128 (IPv6). Splitting adds bits to the prefix: N equal subnets need N to be a power of 2 and add log2(N) bits, and a target prefix /P gives 2^(P − prefix) subnets. Only the first 256 are listed, but the count is exact. An IPv6 address is read as eight 16-bit groups (with “::” standing for one or more zero groups and an optional IPv4 tail) into a BigInt below 2^128, so every value is exact. The compressed form follows RFC 5952, the expanded form pads every group to four digits, and the prefix range is the network address (host bits cleared) to the last address (host bits set). Zone identifiers such as %eth0 are not accepted. Everything runs in your browser; nothing you type is sent anywhere.

Sources

All toolsHome & DIY calculators