IP Subnet Calculator

Enter an IPv4 address in CIDR notation (e.g. 192.168.1.0/24) or with a netmask (192.168.1.0 255.255.255.0).

IP Subnet Calculator (IPv4/CIDR)

Give it an address in CIDR form, say 192.168.1.130/26, and it returns the full picture in one table: network address, broadcast address, subnet mask, wildcard mask, the usable host range, the total and usable host counts, and whether the address is private under RFC 1918 or public, along with its classful range. Old-style input works too. Type the address and netmask separated by a space, like 192.168.1.0 255.255.255.0, and the calculator converts the mask to a prefix length for you, rejecting non-contiguous masks with an explanation instead of a wrong answer.

Press Enter or hit Calculate, or use one of the preset chips to see a /24, a /8, a /20 and a /29 worked out instantly.

Reading the binary view

Under the table, the address, mask and network are shown in dotted binary with the network bits highlighted. This is the part worth slowing down for. Subnetting stops being memorization once you can see that a /26 simply means the first 26 bits are locked and everything after them is host space. The highlight makes that boundary visible.

Edge cases handled properly

A /31 is reported as a point-to-point link with two usable addresses per RFC 3021 rather than the naive "minus two" arithmetic, and a /32 is labeled as a single host with no broadcast. Malformed octets and out-of-range prefixes produce specific error messages.

Subnet math usually comes up while configuring remote machines, so the SSH Config Generator is a natural companion. And if you're studying for a networking exam, the Command Line Quiz makes a decent warm-down.

More tools from CommandLinux

IP Subnet Calculator SSH Config Generator Command Line Quiz Crontab Decoder Systemd Service Generator Chmod Permissions Calculator Tar Command Builder Find Command Composer Grep/Sed Regex Tester Bash Script Boilerplate Generator

Willie has over 15 years of experience in Linux system administration and DevOps. After managing infrastructure for startups and enterprises alike, he founded Command Linux to share the practical knowledge he wished he had when starting out. He oversees content strategy and contributes guides on server management, automation, and security.