Swelıty
Tools for everyone

Free Online IP Subnet Calculator

Work out the network, mask, broadcast and host range of an IPv4 or IPv6 subnet, split it into smaller subnets and see how many hosts fit.

Address and prefix

IPv4 or IPv6 with a prefix or mask

Examples: 10.0.0.0/8, 192.168.1.10 255.255.255.0, 2001:db8::/32

How many hosts do you need?

Find the smallest IPv4 prefix that fits

Counts usable host addresses, not the network and broadcast addresses.

Planning several subnets of different sizes? Use the VLSM Calculator.

Split into smaller subnets

4 subnets

Subnets
NetworkHost rangeBroadcastHosts
192.168.1.0/26192.168.1.1 - 192.168.1.62192.168.1.6362
192.168.1.64/26192.168.1.65 - 192.168.1.126192.168.1.12762
192.168.1.128/26192.168.1.129 - 192.168.1.190192.168.1.19162
192.168.1.192/26192.168.1.193 - 192.168.1.254192.168.1.25562

Subnet details

192.168.1.0/24

Private (RFC 1918)
Network address
192.168.1.0/24
Subnet mask
255.255.255.0
Broadcast address
192.168.1.255
First usable host
192.168.1.1
Last usable host
192.168.1.254
Usable hosts
254
Total addresses
256

How to use

  1. Type an IPv4 or IPv6 address with a prefix length (192.168.1.10/24) or an IPv4 subnet mask (192.168.1.10 255.255.255.0), or press Random to try a new example address.

  2. Read the network, mask, broadcast and host range, and copy any value with its copy button.

  3. To divide the network, choose a longer prefix under Split into smaller subnets, then copy or download the list.

  4. Switch to Practice for exam-style questions: work out the network, broadcast, host range, mask or prefix, then check your answer and read the working.

  5. Turn on Advanced for more: the wildcard mask, binary, hex and integer forms, the blocks that contain the address, and lookup links. The host calculator and the subnet split are in the basic view.

Why use this tool

  • IPv4 and IPv6

    Both address families, with the shortest and the expanded IPv6 forms.

  • CIDR or mask

    Enter a prefix length or a dotted subnet mask. Masks that are not a run of ones are explained, not guessed.

  • Every value copies

    Network, mask, wildcard, broadcast, host range and the binary, hex and integer forms each have a copy button.

  • Split into subnets

    Divide a network at a longer prefix and copy or download the list of subnets with their host ranges.

  • Reverse DNS and IPv6 forms

    The in-addr.arpa name of an IPv4 address, its IPv4-mapped IPv6 form and its 6to4 prefix, and the ip6.arpa name of an IPv6 address.

  • Blocks that contain the address

    See every network from /1 to /32 that holds an IPv4 address, and choose one to calculate it, for example to find the larger network around a host.

  • Hex and integer ranges

    The mask, and the first and last address of the subnet, in hex and as whole numbers.

  • Pick the mask from a list

    Choose any IPv4 mask from /32 to /1, or any IPv6 prefix, from a list beside the address, with the dotted mask shown.

  • Lookup links

    For a public address, open it in RIPEstat, Cloudflare Radar or the BGP Toolkit in one click.

  • Share and remember

    Copy a link that opens the tool with your address in it, and see the last few addresses you used on this device.

  • Random example

    Press Random for a new private IPv4 address or a documentation IPv6 address with a prefix, to try the tool or practise for an exam.

  • Practice mode

    Random questions for networking courses and exams, at three levels, with the answer checked, the working shown and a running score and streak. Choose a round of 10, 20 or your own number of questions, or no limit, and get a score and the types you missed at the end.

  • Host calculator

    Enter the number of hosts you need and get the smallest prefix that fits.

  • Special ranges named

    Private, loopback, link-local, shared address space, documentation, multicast and reserved ranges are labelled.

About this tool

The IP Subnet Calculator works out everything about a network from an address and a prefix. Type an IPv4 address with a CIDR prefix such as 192.168.1.10/24, or with a subnet mask such as 255.255.255.0, and you get the network address, subnet mask, wildcard mask, broadcast address, first and last usable host, the number of usable hosts, the IP class and whether the range is private, public, loopback or another special kind. Every value has its own copy button. The basic view shows the essentials, and the Advanced switch adds the binary, hex and integer forms, along with a bar that shows how many bits name the network and how many name hosts, the reverse DNS name, the IPv4-mapped IPv6 address and the 6to4 prefix. A list beside the address lets you pick the mask or prefix, a list of every block from /1 to /32 that contains the address, the mask and range in hex and as numbers, and for a public address there are links to open it in RIPEstat, Cloudflare Radar or the BGP Toolkit.

It also works for IPv6. Enter an address with a prefix such as 2001:db8::/32 and it shows the network, the first and last address, the total number of addresses, how many /64 networks fit inside and the ip6.arpa name. A longer prefix splits a network into smaller subnets: choose a new prefix and the list of subnets appears, ready to copy or download. If you only know how many hosts you need, enter that number under How many hosts do you need and the tool names the smallest prefix that fits.

It is useful for planning a network, checking a firewall or cloud security group rule, studying for a networking exam, or checking an address plan before you configure it. For other developer checks see the URL Encoder and the Hash Generator.

Frequently asked questions

CIDR writes a network as an address and a prefix length, such as 192.168.1.0/24. The number after the slash is how many bits at the start of the address belong to the network, so /24 means a subnet mask of 255.255.255.0.

A subnet has 2 to the power of (32 minus the prefix) addresses. For IPv4 two of them, the network and broadcast addresses, are not usable by hosts, so a /24 has 256 addresses and 254 usable hosts.

It is the subnet mask turned inside out. The wildcard of 255.255.255.0 is 0.0.0.255. Some routers and access lists use it instead of a mask.

A /32 is a single address. A /31 has two addresses and, on a point-to-point link, both can be used, as set out in RFC 3021, so there is no network or broadcast address to give up.

Enter the network, then choose a longer prefix under Split into smaller subnets. Each extra bit doubles the number of subnets and halves their size, so splitting a /24 at /26 gives four subnets.

Classes A to E come from an older scheme that tied the network size to the first bits of the address. Today networks use CIDR and any prefix length, so the class does not decide the mask.

Choose a level and the question types, then answer each question, for example the network address of 172.16.37.201/20. The tool checks your answer, shows how to work it out and keeps a score and a streak. A round can be 10, 20 or a number you choose (up to 200), or unlimited, and a finished round shows your score, best streak and the question types you missed. Easy uses prefixes from /24 to /30, medium /16 to /30 and hard /8 to /30.

It saves the last few addresses you used, and your Practice totals (questions answered, correct and best streak), in your browser storage. The Swelity server does not receive them. The Swelity server does not receive that list, and the Clear link next to it removes it. A link made with Copy link carries the address in its web address, so only share it if you are happy to share that address.

No. It does the maths on the text you type and does not look up addresses, test connections or find your own address. For a public address the results show links to RIPEstat, Cloudflare Radar and the BGP Toolkit. Those open in a new tab, and the address is sent to those sites only if you open one.