export const page = { title: 'Subnet Calculator', template: () => `
Enter an IPv4 address, e.g. 192.168.1.0
Usable Hosts
254
Subnet Mask
255.255.255.0
Network ID
-
network address
First Host
-
1st usable address
Last Host
-
last usable address
Broadcast
-
send to all devices
Network Address
The first address — identifies the network itself. No device can use this address.
Host Addresses
All addresses in between — assignable to devices like PCs, servers, or printers.
Broadcast Address
The last address — packets sent here are delivered to every device in the network.
Typical Networks — click to try
Think of a city. Every house has a full address: district + house number. A subnet works the same way — every IP address is split into two parts.
Network part (district)
192.168.1.___
All devices in the same subnet share this part — like neighbours on the same street.
Host part (house number)
___.42
Each device gets a unique number within the network.
An IP address is made up of exactly 32 bits (ones and zeros) under the hood. The /24 says: “the first 24 bits belong to the network, the remaining 8 bits are the host number.”
8 host bits = 28 = 256 addresses, 254 usable (minus network ID and broadcast).
Organisation
Group devices logically — e.g. keep office PCs separate from servers or guest Wi-Fi.
Security
Isolate networks from each other — malware on the guest network can't reach corporate systems.
Efficiency
Broadcast traffic stays within the subnet — no unnecessary noise for the rest of the network.
| Range | CIDR | Subnet Mask | Description | Action |
|---|---|---|---|---|
| 192.168.0.0 – 192.168.255.255 | /16 (total) | 255.255.0.0 | Class C (commonly used as /24) | Example /24 |
| 172.16.0.0 – 172.31.255.255 | /12 (total) | 255.240.0.0 | Class B | Example /16 |
| 10.0.0.0 – 10.255.255.255 | /8 (total) | 255.0.0.0 | Class A | Example /8 |
Click an example to populate the fields and run the calculation.