Your country

Tools that support it use your country for local currency, number formats, units and paper size. Your choice is saved only in this browser.

Type a name or a two-letter code. Use the up and down arrow keys to move through the countries, Enter to choose one and Escape to close.

Subnet Calculator

Everything about an IP subnet: network, broadcast, host range, masks and splits.

Network No upload Works offline Free, no sign-up

Address and subnet mask

For example 192.168.1.10/24, 10.0.0.1 255.255.255.0, a wildcard mask such as 0.0.0.255, or 2001:db8::1/64. Pasted ipconfig or ip addr output works too.

Used when the address has no mask of its own.

Try:

Subnet details

Network 192.168.1.0/24

Hosts 192.168.1.1 – 192.168.1.254 · Private-use (RFC 1918)

254Usable hosts
256Total addresses
/24Prefix length
255.255.255.0Subnet mask

2^8 − 2 = 254 (the network and broadcast addresses are not usable).

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
Usable hosts
254
Total addresses
256
Subnet mask
255.255.255.0
Wildcard mask
0.0.0.255
Prefix length
/24
Mask (hex)
0xffffff00
Mask (binary)
11111111.11111111.11111111.00000000
IP class (legacy)
C (default /24)
Address type
Private-use (RFC 1918)
Network as integer
3232235776
Network (hex)
0xc0a80100
Reverse DNS zone
1.168.192.in-addr.arpa

Binary view

The first 24 bits (highlighted) are the network part; the remaining 8 bits are the host part.

Address, mask, network and broadcast in binary, network bits first
Address 11000000.10101000.00000001 . 00001010 192.168.1.10
Subnet mask 11111111.11111111.11111111 . 00000000 255.255.255.0
Network 11000000.10101000.00000001 . 00000000 192.168.1.0
Broadcast 11000000.10101000.00000001 . 11111111 192.168.1.255

Is this IP in the subnet?

Split into subnets

4 subnets of 64 addresses (62 usable hosts each).

Subnets of the chosen size, with usable range and broadcast address
# Subnet Usable range Broadcast Hosts
1 192.168.1.0/26 192.168.1.1 – 192.168.1.62 192.168.1.63 62
2 192.168.1.64/26 192.168.1.65 – 192.168.1.126 192.168.1.127 62
3 192.168.1.128/26 192.168.1.129 – 192.168.1.190 192.168.1.191 62
4 192.168.1.192/26 192.168.1.193 – 192.168.1.254 192.168.1.255 62

Next steps

About the Subnet Calculator

Type an IP address with its prefix or mask — 192.168.1.10/24, 10.20.30.40 255.255.240.0 or even a wildcard mask such as 0.0.0.255 — and the calculator shows the subnet it belongs to: the network address, broadcast address, first and last usable host, how many hosts fit, the subnet mask, wildcard mask, prefix length and the same values in binary and hex. It also tells you the legacy class and whether the address is private, carrier-grade NAT, documentation or another special-purpose block from the IANA registries.

Two extra tools are built in: Split into subnets lists every smaller subnet of a longer prefix (with CSV export), and Is this IP in the subnet? answers instantly and says when an address is the unusable network or broadcast address. IPv6 prefixes work too. Everything is calculated in your browser — nothing is sent anywhere.

How to use it

  1. Enter an address in the first box. Add the mask there (/24, 255.255.255.0 or a wildcard such as 0.0.0.255), or pick a prefix in the Subnet mask list.
  2. Read the results: the network and broadcast addresses, the usable host range and count, and the masks in every notation. The binary view shows where the network bits end and the host bits begin.
  3. To divide the subnet, choose a longer prefix under Split into subnets; the list shows each subnet with its usable range and broadcast address. Download it as CSV for documentation.
  4. To check an address, type it under Is this IP in the subnet?.
  5. Use Copy results to paste the summary into a ticket or configuration notes, and Previous / Next subnet to step through neighbouring subnets of the same size.

Examples

A home network (/24)
Input
192.168.1.10/24
Result
Network 192.168.1.0/24 · Broadcast 192.168.1.255
Usable hosts 192.168.1.1 – 192.168.1.254 (254)
Mask 255.255.255.0 · Wildcard 0.0.0.255 · Class C · Private-use (RFC 1918)
A /20 from a dotted mask
Input
10.20.30.40 255.255.240.0
Result
Network 10.20.16.0/20 · Broadcast 10.20.31.255
Usable hosts 10.20.16.1 – 10.20.31.254 (4,094)
Wildcard 0.0.15.255 · reverse DNS: 16 zones, 16.20.10.in-addr.arpa – 31.20.10.in-addr.arpa

The third octet 30 is 0001 1110 in binary; the mask keeps its first four bits (1111 0000), which gives 0001 0000 = 16.

A point-to-point link (/31)
Input
203.0.113.9/31
Result
Network 203.0.113.8/31 · no broadcast address
Usable: 203.0.113.8 and 203.0.113.9 (2)

RFC 3021 lets both addresses of a /31 be used on point-to-point links, saving half the addresses of a /30.

Splitting a /24 into four /26 subnets
Input
192.168.1.0/24 → split into /26
Result
192.168.1.0/26 (.1 – .62, broadcast .63)
192.168.1.64/26 (.65 – .126, broadcast .127)
192.168.1.128/26 (.129 – .190, broadcast .191)
192.168.1.192/26 (.193 – .254, broadcast .255)
An IPv6 LAN prefix
Input
2001:db8:abcd:12::1/64
Result
Network 2001:db8:abcd:12::/64
Last address 2001:db8:abcd:12:ffff:ffff:ffff:ffff
2^64 addresses · reverse zone 2.1.0.0.d.c.b.a.8.b.d.0.1.0.0.2.ip6.arpa

Common uses

  • Working out the gateway, DHCP range and broadcast address before configuring a router, VLAN or cloud subnet.
  • Checking whether two devices are in the same subnet when they cannot reach each other.
  • Converting between prefix lengths, subnet masks and the wildcard masks used in Cisco ACLs and OSPF network statements.
  • Practising and checking subnetting answers for CCNA, CompTIA Network+ and networking courses.
  • Splitting an allocation into equal subnets and exporting the list for documentation or an IP address management tool.

How the subnet is calculated

An IPv4 address has 32 bits. The prefix length says how many of the leftmost bits are the network part; the rest are the host part (RFC 4632). The network address is the address with all host bits set to 0 (address AND mask) and the broadcast address has all host bits set to 1 (network OR wildcard mask).

  • Total addresses = 2^(32 − prefix): a /24 has 2^8 = 256.
  • Usable hosts = total − 2, because the network and broadcast addresses cannot be given to a host (RFC 950): a /24 has 254.
  • Wildcard mask = 255.255.255.255 − subnet mask, octet by octet: 255.255.240.0 becomes 0.0.15.255.

/31 and /32 subnets

A /31 has only two addresses. On point-to-point links there is no need for network or broadcast addresses, so RFC 3021 allows both to be used — the calculator shows 2 usable hosts and no broadcast address. A /32 is one single address, used for loopback interfaces, host routes and firewall rules.

Masks, wildcard masks and prefix lengths

/24, 255.255.255.0 and the wildcard 0.0.0.255 all describe the same subnet. The calculator accepts all three: a dotted value is read as a subnet mask when its 1-bits are contiguous from the left, otherwise as a wildcard mask when they are contiguous from the right. Masks such as 255.0.255.0 are rejected because subnet masks must be contiguous. Two values are ambiguous — 0.0.0.0 and 255.255.255.255 — and are read as subnet masks (/0 and /32); the result says so.

You can also paste output from devices: ip address 10.1.1.1 255.255.255.252 (router configs), inet 10.0.0.5/8 (Linux ip addr), netmask 0xffffff00 (macOS ifconfig) or both lines of Windows ipconfig.

Classes and special-purpose addresses

Classes A (first octet 0–127), B (128–191) and C (192–223) come from the original Internet Protocol specification (RFC 791); class D (224–239, multicast) and class E (240–255, "reserved for future addressing modes") were added by RFC 1112 in 1989. Classes were replaced by classless addressing (CIDR) in 1993; the calculator shows them because exams and older documentation still use them.

The address type comes from IANA’s special-purpose address registries (RFC 6890): private-use 10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16 (RFC 1918), shared address space 100.64.0.0/10 for carrier-grade NAT (RFC 6598), documentation ranges (RFC 5737), loopback, link-local, benchmarking, multicast and more. If your subnet is bigger than the special block its address is in — say 192.168.0.0/15 — the result warns that it also covers other space.

Reverse DNS zones

Reverse DNS for IPv4 lives in in-addr.arpa zones on octet boundaries: a /24 such as 192.168.1.0/24 is the zone 1.168.192.in-addr.arpa, a /20 needs sixteen /24 zones, and a /16 is one zone. Subnets smaller than a /24 cannot have a zone of their own; their provider delegates them with CNAME records as described in RFC 2317. For IPv6, reverse zones are in ip6.arpa on 4-bit (nibble) boundaries, so a /62 takes four /64 zones.

IPv6 prefixes

IPv6 addresses have 128 bits and no broadcast address; every address in the prefix can be used, though the first one is the subnet-router anycast address (RFC 4291 §2.6.1). LANs are normally /64, because stateless address autoconfiguration uses a 64-bit interface identifier, so the calculator also shows how many /64 subnets a shorter prefix holds. Prefix splits are paged, since a /48 already contains 65,536 /64s.

Limitations

  • It calculates one subnet at a time and splits it into equal parts. To divide a network into subnets of different sizes, use the VLSM calculator; to turn an arbitrary start–end range into CIDR blocks, use IP range to CIDR.
  • Subnet lists show 256 rows at a time, and the CSV export is limited to 65,536 subnets.
  • The address type says what the IANA registries reserve a block for; it cannot tell whether a particular address is in use on a network.

Privacy

Everything happens in your browser. What you enter or open here is not uploaded or stored by MySmartCoPilot.

Frequently asked questions

How many usable hosts are in a /24?

254. A /24 has 2^8 = 256 addresses; the first (network address) and last (broadcast address) cannot be assigned to devices. The general formula is 2^(32 − prefix) − 2, except for /31 (2 usable on point-to-point links) and /32 (1).

What is the difference between a subnet mask and a wildcard mask?

They are the inverse of each other. A subnet mask has 1-bits for the network part (255.255.255.0); a wildcard mask has 1-bits for the host part (0.0.0.255). Cisco access lists and OSPF network statements use wildcard masks. This calculator accepts either and shows both.

How do I know if two IP addresses are in the same subnet?

Apply the mask to both: if address AND mask gives the same network address, they are in the same subnet. Enter one address with its mask here and type the other under Is this IP in the subnet? — the answer also says which subnet the other address is in.

What is the broadcast address used for?

Packets sent to the broadcast address (all host bits 1, for example 192.168.1.255 in 192.168.1.0/24) reach every device on that subnet — protocols such as DHCP and ARP rely on local broadcasts. Because of this it cannot be assigned to a single device.

Can I use a /31 subnet?

Yes, on point-to-point links between two routers. RFC 3021 defines /31s with both addresses usable and no broadcast address; most current router and firewall software supports them. Do not use a /31 for a LAN with a broadcast domain.

Why does the calculator say my address has host bits set?

You entered a host address, such as 192.168.1.10/24, rather than the network address. That is normal for an interface address; the calculator shows the network it belongs to (192.168.1.0/24). Some systems, such as route tables and firewall objects, require the network address itself.

Quick answers and tool search

Type to search tools or to get a quick answer, for example 18% of 2500. Use the up and down arrow keys to move through the results, Enter to choose, and Escape to close.