IPv4 Subnet Calculator
Calculate subnet details from an IP plus a netmask or prefix. Accepts 255.255.255.0 or /24 — works the same either way.
Quick answer: Calculate subnet details from an IP plus a netmask or prefix. Accepts 255.255.255.0 or /24 — works the same either way.
Last updated
Frequently asked questions
- How do I calculate a subnet mask?
- Pick a prefix length based on how many hosts you need. /24 fits ~250 hosts; /26 fits ~60; /28 fits ~14. The calculator converts the prefix to a dotted netmask for you.
- What's the difference between /24 and 255.255.255.0?
- Nothing — they're the same network mask written two ways. CIDR notation is just shorter.
- How many hosts fit in my subnet?
- Total addresses are 2^(32-prefix). Usable hosts subtract 2 (network + broadcast) for prefixes up to /30. /31 and /32 are special-cased.
- What is a gateway address?
- It's just the host address that routes packets off-subnet. Network operators conventionally pick the first or last usable host (e.g. .1 or .254).
- What is broadcast?
- The all-ones address inside a subnet. Sending a packet there delivers it to every host on the subnet — used by older protocols like ARP.
- How do I pick a subnet for 50 devices?
- /26 gives you 62 usable hosts, the smallest prefix that fits 50 with room to grow. /27 only fits 30, which would be tight.
- What's the difference between public and private IP?
- Public IPs are globally unique and routable on the internet. Private IPs (10/8, 172.16/12, 192.168/16) are reserved for internal networks and require NAT to reach the internet.
- How does DHCP work with subnets?
- DHCP servers hand out IPs from a pool inside one subnet. The pool is usually a slice of the subnet leaving room for static IPs (servers, gateways).
- Can I plan subnets for multiple VLANs?
- Yes — most operators carve a parent block (e.g. /16) into a /24 per VLAN. Calculate one VLAN at a time here, or sketch the plan in a spreadsheet.
- Can I use this for AWS/VPC?
- Yes for the math. AWS reserves 5 IPs in every subnet (network, VPC router, DNS, future use, broadcast), so subtract those from the 'usable hosts' the calculator shows.