IPv4 subnet calculator

Enter an IP and its mask (as /24 or 255.255.255.0) to get the network, broadcast address, host range and how to split it.

Network
192.168.1.0/24
Subnet mask
255.255.255.0
Wildcard mask
0.0.0.255
Broadcast
192.168.1.255
First host
192.168.1.1
Last host
192.168.1.254
Usable hosts
254
Total addresses
256
Class
C
Type
Private (RFC 1918)

In binary

IP in binary
11000000.10101000.00000001.00001010
Mask in binary
11111111.11111111.11111111.00000000
IP in hexadecimal
0xC0A8010A

Split into subnets

4 subnets

NetworkFirst hostLast hostBroadcast
192.168.1.0/26192.168.1.1192.168.1.62192.168.1.63
192.168.1.64/26192.168.1.65192.168.1.126192.168.1.127
192.168.1.128/26192.168.1.129192.168.1.190192.168.1.191
192.168.1.192/26192.168.1.193192.168.1.254192.168.1.255

How to calculate a subnet

  1. Enter the IP address, for example 192.168.1.10, or simply 192.168.1.10/24.

  2. Pick the mask in CIDR (/24) or dotted decimal (255.255.255.0) form and click “Calculate”.

  3. Check the network, broadcast and host range, and choose a size to see how to split it into equal subnets.

What is a subnet and what is it for?

A subnet is a slice of an IP network. Splitting a network into subnets lets you separate departments, floors or services (office, guests, cameras), cut down broadcast traffic and apply different security rules to each part.

The mask says which part of the address identifies the network and which part identifies the hosts. In CIDR notation it is written as the number of network bits: /24 means the first 24 bits are the network and the remaining 8 are left for hosts.

How it is calculated, step by step

Take 192.168.1.130/26. A /26 mask leaves 32 − 26 = 6 bits for hosts, that is 2⁶ = 64 addresses per subnet. /26 subnets start every 64 addresses: .0, .64, .128 and .192.

  • Network: the multiple of 64 just below .130, that is 192.168.1.128.
  • Broadcast: the last address in the block, 192.168.1.191.
  • Usable hosts: from 192.168.1.129 to 192.168.1.190, 64 − 2 = 62 in total.
  • Dotted decimal mask: 255.255.255.192 (the first 26 bits set to 1).

The general rule: there are 2ⁿ addresses, where n is the number of host bits, and you subtract two (network and broadcast) to get the usable hosts. The exceptions are /31, which uses both addresses on point-to-point links (RFC 3021), and /32, which identifies a single host.

Most common subnet masks

  • /8 · 255.0.0.0 · 16,777,214 hosts
  • /16 · 255.255.0.0 · 65,534 hosts
  • /22 · 255.255.252.0 · 1,022 hosts
  • /23 · 255.255.254.0 · 510 hosts
  • /24 · 255.255.255.0 · 254 hosts
  • /25 · 255.255.255.128 · 126 hosts
  • /26 · 255.255.255.192 · 62 hosts
  • /27 · 255.255.255.224 · 30 hosts
  • /28 · 255.255.255.240 · 14 hosts
  • /29 · 255.255.255.248 · 6 hosts
  • /30 · 255.255.255.252 · 2 hosts

IP classes and private ranges

Before CIDR, networks were handed out by class based on the first number: class A (1-126), B (128-191) and C (192-223); class D (224-239) is multicast and E (240-255) is experimental. Classes no longer limit network sizes, but they still show up in exams and documentation.

Private ranges (RFC 1918) are not routed on the internet and can be used freely inside any network: 10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16. In addition, 100.64.0.0/10 is reserved for carrier-grade NAT.

Frequently asked questions

How many hosts are in a /24 network?

256 addresses in total, 254 of which can be assigned to devices: the network address (.0) and the broadcast address (.255) are reserved.

What is a wildcard mask?

It is the inverted mask: host bits set to 1 and network bits set to 0. For /24 it is 0.0.0.255. It is mostly used in access lists (ACLs) and OSPF on Cisco devices.

How do I convert a dotted decimal mask to CIDR?

Count the 1 bits in the mask written in binary. 255.255.255.0 has 8 + 8 + 8 = 24 ones, so it is /24. The calculator accepts both formats.

Why are two addresses subtracted from each subnet?

The first address identifies the network itself and the last one is the broadcast address, which reaches every device in the subnet. Neither can be assigned to a device.

Is it useful for CCNA prep?

Yes. It shows the IP and mask in binary so you can check every step by hand, and the subnet splitting helps you practice subnetting exercises.