Professional IP subnetting calculator in your terminal. Fast, accurate, and beautiful.
curl -sSL https://raw.githubusercontent.com/mikegilkim/subnet-calculator/main/install.sh | sudo bashInteractive Mode:
subnetDirect Calculation:
subnet 192.168.1.0/24
subnet 10.0.0.0/8
subnet 172.16.0.0/16- Network address and broadcast address
- Subnet mask and wildcard mask
- CIDR notation
- Usable IP range (first and last)
- Total IPs and usable hosts
- IP Class Detection (A, B, C, D, E)
- IP Type (Private vs Public)
- Identifies RFC1918 private ranges
- Decimal - Standard dotted notation
- Binary - 8-bit octet format
- Hexadecimal - For network programming
- Shows how to divide into smaller subnets
- Lists up to 8 example subnets
- Includes usable ranges for each
- Common CIDR notations (/24 to /32)
- Subnet masks for each
- Total IPs and usable hosts
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β SUBNET CALCULATOR RESULTS β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
βΆ INPUT
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
IP Address / CIDR: 192.168.1.0/24
βΆ IP ADDRESS INFORMATION
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
IP Class: C (Small Networks)
IP Type: Yes (192.168.0.0/16)
βΆ NETWORK INFORMATION
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Network Address: 192.168.1.0
Broadcast Address: 192.168.1.255
Subnet Mask: 255.255.255.0
Wildcard Mask: 0.0.0.255
CIDR Notation: /24
βΆ USABLE IP RANGE
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
First Usable IP: 192.168.1.1
Last Usable IP: 192.168.1.254
Total IP Addresses: 256
Usable Hosts: 254
βΆ BINARY REPRESENTATION
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
IP Address (Binary): 11000000.10101000.00000001.00000000
Subnet Mask (Binary): 11111111.11111111.11111111.00000000
Network Address (Binary): 11000000.10101000.00000001.00000000
βΆ SUBNET DIVISION EXAMPLES
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Divide /24 into /25 subnets:
Subnet 1: 192.168.1.0/25
Range: 192.168.1.1 - 192.168.1.126
Subnet 2: 192.168.1.128/25
Range: 192.168.1.129 - 192.168.1.254
Perfect for:
- π Network Engineers - Plan subnet allocations
- π Students - Learn subnetting concepts
- π§ System Administrators - Quick network calculations
- π CCNA/Network+ Prep - Practice subnetting
- π’ IT Professionals - Network design and troubleshooting
- Linux (Ubuntu, Debian, CentOS, RHEL, Arch)
- Bash 4.0+
- bc (auto-installed)
subnet 192.168.1.0/24Shows 256 total IPs, 254 usable hosts
subnet 10.0.0.0/8Shows 16,777,216 total IPs
subnet 192.168.1.0/30Shows point-to-point links (2 usable hosts)
subnet 192.168.1.1/32Shows single host subnet
wget https://raw.githubusercontent.com/mikegilkim/subnet-calculator/main/subnet-calc.sh
chmod +x subnet-calc.sh
sudo mv subnet-calc.sh /usr/local/bin/subnet-calc
echo "alias subnet='/usr/local/bin/subnet-calc'" >> ~/.bashrc
source ~/.bashrcThe first address in the subnet. Cannot be assigned to hosts.
The last address in the subnet. Used to send messages to all hosts.
IPs between network and broadcast that can be assigned to devices.
Defines which portion of IP is network vs host.
Inverse of subnet mask. Used in access control lists (ACLs).
Compact way to represent subnet mask (/24 = 255.255.255.0).
| CIDR | Subnet Mask | Usable Hosts | Common Use |
|---|---|---|---|
| /8 | 255.0.0.0 | 16,777,214 | Large enterprise |
| /16 | 255.255.0.0 | 65,534 | Medium enterprise |
| /24 | 255.255.255.0 | 254 | Small network |
| /25 | 255.255.255.128 | 126 | Small subnet |
| /26 | 255.255.255.192 | 62 | Smaller subnet |
| /27 | 255.255.255.224 | 30 | Tiny subnet |
| /28 | 255.255.255.240 | 14 | Very small |
| /29 | 255.255.255.248 | 6 | Point-to-multipoint |
| /30 | 255.255.255.252 | 2 | Point-to-point |
| /31 | 255.255.255.254 | 2 | Point-to-point (RFC3021) |
| /32 | 255.255.255.255 | 1 | Single host |
- 10.0.0.0/8 - 10.0.0.0 to 10.255.255.255
- 172.16.0.0/12 - 172.16.0.0 to 172.31.255.255
- 192.168.0.0/16 - 192.168.0.0 to 192.168.255.255
Quick Class C Subnetting:
subnet 192.168.1.0/24 # 254 hosts
subnet 192.168.1.0/25 # 126 hosts (2 subnets)
subnet 192.168.1.0/26 # 62 hosts (4 subnets)
subnet 192.168.1.0/27 # 30 hosts (8 subnets)Point-to-Point Links:
subnet 10.0.0.0/30 # 2 usable IPs for router linksVerify Your Network Design:
subnet 172.16.0.0/22 # Check if your allocation fits"bc: command not found"
sudo apt install bc -y"Permission denied"
sudo subnet 192.168.1.0/24"Invalid IP address"
- Check format: must be X.X.X.X/Y
- Octets must be 0-255
- CIDR must be 0-32
MIT - Use freely, modify as needed.
- OpenVPN Monitor - VPN connection monitoring
- System Monitor - Server resource monitoring
- Fail2ban Dashboard - Security monitoring