Toolvito

Works on this device

IP & Subnet Calculator

Type an IP address with a prefix length or a subnet mask. The tool shows the network address, the broadcast address, the usable host range and the mask in every common form. Other options split a network, plan subnets of different sizes, join routes and handle IPv6.

Enter your values

Network address, broadcast address, host range and mask for an IPv4 address.

Your values

Examples: 192.168.1.130/26, 192.168.1.130 255.255.255.192, or 192.168.1.130 0.0.0.63 with a wildcard mask.

More options

Your values are worked out in this browser. They are not sent to a server.

Your result will show here

Fill in the values, then choose Calculate.

How to use this calculator

  1. Choose what you want to work out, for example Subnet details from an IP address and mask.
  2. Type the address. Add the prefix length after a slash, such as 192.168.1.130/26. You can type a mask in its place, such as 192.168.1.130 255.255.255.192.
  3. Choose Calculate.
  4. Read the result. You can copy it, print it, or download it as a CSV file. Tables with many rows are complete in the CSV file.

What each option does

  • Subnet details: network address, broadcast address, first and last host, number of hosts, mask, wildcard mask, binary forms, address class and address type.
  • Convert a prefix length, subnet mask or wildcard mask: changes between /24, 255.255.255.0 and 0.0.0.255.
  • Subnet size for a number of hosts: the smallest subnet with room for your hosts.
  • Subnet chart: a table of all prefix lengths with masks and host counts.
  • Split a network into equal subnets: by number of subnets, by hosts in each subnet, or by a new prefix length.
  • VLSM: gives each group a subnet that fits its own number of hosts.
  • Summarize networks: joins networks into the shortest list of CIDR blocks and finds one supernet that holds them all.
  • Check networks for overlap and Check if an address is in a subnet.
  • IP range to CIDR blocks and List the addresses in a network.
  • Convert an IPv4 address between dotted form, one whole number, binary and hex.
  • Check an address: tests the form and names the range, such as private, public, loopback or multicast.
  • IPv6: short and full forms, prefix details, splitting a prefix, IPv4 inside IPv6, and EUI-64 addresses from a MAC address.

The method

  • An IPv4 address is a number of 32 bits. The prefix length says how many bits at the left name the network. The other bits name the host.
  • The subnet mask has a 1 for every network bit. A /26 mask is 26 ones and 6 zeros: 255.255.255.192.
  • Network address = address AND mask. Broadcast address = network address with all host bits set to 1.
  • Total addresses = 2 to the power of the host bits. Usable hosts = total − 2, because the network and broadcast addresses are not given to hosts.
  • A /31 has 2 usable addresses for a link between two routers (RFC 3021). A /32 is one single address.
  • The wildcard mask is the mask with every bit turned over. Access lists and OSPF use it.
  • IPv6 works the same way with 128 bits. It has no broadcast address, and all addresses of a prefix can be used.

Worked example

Address 192.168.1.130/26. The mask is 255.255.255.192. The last number of the address is 130, which is 10000010 in binary. The last number of the mask is 192, which is 11000000. AND gives 10000000, which is 128. So the network address is 192.168.1.128.

There are 6 host bits, so the subnet has 2 × 2 × 2 × 2 × 2 × 2 = 64 addresses, from 192.168.1.128 to 192.168.1.191. The last one, 192.168.1.191, is the broadcast address. The usable hosts are 192.168.1.129 to 192.168.1.190, which is 62 addresses.

VLSM example for 192.168.1.0/24 with groups of 100, 50, 20 and 2 hosts: the groups get 192.168.1.0/25, 192.168.1.128/26, 192.168.1.192/27 and 192.168.1.224/30. That uses 228 addresses and leaves 28.

Private and special address ranges

  • Private IPv4 (RFC 1918): 10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16.
  • Loopback: 127.0.0.0/8. Link-local: 169.254.0.0/16. Shared space for carrier-grade NAT (RFC 6598): 100.64.0.0/10.
  • Multicast: 224.0.0.0/4. Reserved: 240.0.0.0/4. Documentation (RFC 5737): 192.0.2.0/24, 198.51.100.0/24 and 203.0.113.0/24.
  • IPv6: fc00::/7 unique local (private), fe80::/10 link-local, ff00::/8 multicast, 2001:db8::/32 documentation, 2000::/3 global unicast.

Limits you should know

  • The tool only does address maths. It does not look up the owner or place of an address, check blocklists, resolve DNS names, ping or trace a route.
  • It cannot read the subnet mask or gateway of your own device. Look in the network settings of the device.
  • A mask cannot be found from an address alone. If you type no prefix, the old class default is used, and the result says so.
  • The default gateway is a choice made by the network owner. Many networks use the first or the last usable address.
  • Address parts with a zero at the start, such as 192.168.01.1, are not accepted, because some systems read them in another way.
  • Tables list at most 1,024 subnets. The address list is limited to 65,536 addresses.
  • Route summarizing, overlap checks, VLSM and range to CIDR work with IPv4 only.
  • The option for AWS and Azure keeps back five addresses in each subnet. Check the current rules of your provider before you build a network.

Related tools