Skip to content
Free tool

IP Subnet Calculator – calculate subnet masks online

The IP Subnet Calculator instantly calculates the subnet mask (including in binary), network and broadcast addresses, wildcard mask, and usable host range from a CIDR address such as 192.168.1.0/24. In “CIDR ↔ IP Range” mode, you can convert CIDR blocks to IP ranges and back, including for IPv6. Free, with no sign-up required—the calculation runs right in your browser.

Built by Jakub Martyniak

Planning your own network? Get full control over your IPs.

Results appear as you type—no need to submit. Without a “/prefix length”, we automatically assume /24.

Network address

Broadcast address

Subnet mask

Subnet mask (binary)

Wildcard mask

Prefix length

Usable host range

Usable hosts

Total addresses

Example result

What the Subnet Calculator calculates

You enter a CIDR address, and the calculator immediately shows the network and broadcast addresses, subnet and wildcard masks, and the number of usable hosts. The values below are an example; your result depends on your input.

Example · Input: 192.168.1.0/24

Network address
192.168.1.0
The first address in the network. It identifies the network itself and is not assigned to a device.
Broadcast address
192.168.1.255
The last address in the network. Packets sent to it reach every device on the subnet.
Subnet mask
255.255.255.0/24
The first 24 bits belong to the network; the rest are available for hosts.
Wildcard mask
0.0.0.255
The inverse subnet mask used by Cisco ACLs and OSPF.
Usable hosts
254
Usable host range: 192.168.1.1 to 192.168.1.254.
Total addresses
256
The network and broadcast addresses are excluded from this.

Why this tool

Subnet mask, host range and CIDR conversion at a glance

Key features of the calculator.

CIDR Input

Just enter an address like 192.168.1.0/24—no separate mask needed.

Network & broadcast address

Network and broadcast addresses are calculated automatically from the CIDR input.

Subnet mask in binary, too

Alongside dotted-decimal notation, the calculator shows the subnet mask bit by bit, making the calculation easier to follow.

Wildcard mask

The wildcard mask for Cisco ACLs and OSPF configurations is displayed alongside it.

Usable host addresses

See immediately how many host addresses are actually usable in the subnet.

No account required

Just enter a CIDR range and calculate—no sign-up required.

Runs only in the browser

The calculation runs locally in your browser; nothing is sent to a server when you calculate.

CIDR to IP range

See the first and last addresses and the number of addresses in a CIDR block at a glance.

IP range to CIDR

Calculate the smallest possible list of CIDR blocks from a start and end address, for example for firewall rules.

IPv4 and IPv6

The converter also handles 128-bit addresses and displays large address counts exactly.

Export as TXT or CSV

In conversion mode, download all addresses in a block or range as a list, up to 1.048.576 addresses.

Share the result via a link

Your input is included in the page URL, so you can easily share a calculation.

How it works

How the subnet calculator works

Get all subnet values from a CIDR address in just a few steps.

  1. Step 1

    Enter CIDR address

    Enter an IPv4 address with a prefix length, e.g. 192.168.1.0/24. Without “/”, the calculator assumes /24.

  2. Step 2

    See results instantly

    Results appear as you type, without submitting: network and broadcast addresses, subnet mask (including in binary), wildcard mask, prefix length, usable host range, and host count.

  3. Step 3

    Copy values

    Copy the network address, broadcast address, subnet mask, wildcard mask, or host range using the copy button beside each field.

  4. Step 4

    Convert between CIDR and IP ranges

    Switch to “CIDR ↔ IP Range” mode: convert a CIDR block to its first and last addresses, or an IP range to the smallest possible list of CIDR blocks, for IPv4 and IPv6.

  5. Step 5

    Export or share

    In conversion mode, download all addresses as TXT or CSV (up to 1,048,576 addresses), or share the calculation using the page URL, which includes your input.

CIDR ↔ IP range

Convert CIDR to an IP range and back

Firewalls, allowlists, and provider portals may require either a CIDR block or a start-to-end range. This converter switches between the two for IPv4 and IPv6.

CIDR to IP range

The first address is the block's network address; the last is obtained by setting all host bits to 1.

192.168.0.0/16
192.168.0.0 - 192.168.255.255
65,536 addresses
10.0.0.0/8
10.0.0.0 - 10.255.255.255
16,777,216 addresses
203.0.113.64/26
203.0.113.64 - 203.0.113.127
64 addresses
2001:db8::/32
2001:db8:: - 2001:db8:ffff:ffff:ffff:ffff:ffff:ffff
2^96 addresses

IP range to CIDR

A range can only be written as a single block if it starts and ends at valid boundaries. Otherwise, multiple blocks are needed; the converter produces the smallest possible list.

10.0.0.5 - 10.0.0.20

  • 10.0.0.5/32
  • 10.0.0.6/31
  • 10.0.0.8/29
  • 10.0.0.16/30
  • 10.0.0.20/32

Together, the five blocks cover exactly the 16 addresses from 10.0.0.5 to 10.0.0.20, no more and no less.

Calculate subnet mask

Subnet mask table and calculation steps

The table shows the subnet mask, wildcard mask and number of addresses for common prefix lengths. Below it, we work through a subnet calculation step by step.

Subnet mask table from /8 to /32
PrefixSubnet maskWildcard maskTotal addressesUsable hosts
/8255.0.0.00.255.255.25516,777,21616,777,214
/16255.255.0.00.0.255.25565,53665,534
/20255.255.240.00.0.15.2554,0964,094
/21255.255.248.00.0.7.2552,0482,046
/22255.255.252.00.0.3.2551,0241,022
/23255.255.254.00.0.1.255512510
/24255.255.255.00.0.0.255256254
/25255.255.255.1280.0.0.127128126
/26255.255.255.1920.0.0.636462
/27255.255.255.2240.0.0.313230
/28255.255.255.2400.0.0.151614
/29255.255.255.2480.0.0.786
/30255.255.255.2520.0.0.342
/31255.255.255.2540.0.0.122
/32255.255.255.2550.0.0.011

For /31 and /32, the calculator counts every address as usable: /31 is for point-to-point links under RFC 3021, and /32 represents a single host address.

Step-by-step calculation for 192.168.1.130/26

  1. 1

    Convert prefix length to subnet mask

    /26 means the first 26 bits of the mask are set to 1 and the rest to 0. This gives the subnet mask 255.255.255.192, or 11111111.11111111.11111111.11000000 in binary.

  2. 2

    Calculate the network address

    The IP address and subnet mask are combined with a bitwise AND: 192.168.1.130 AND 255.255.255.192 gives the network address 192.168.1.128.

  3. 3

    Calculate the broadcast address

    All host bits are set to 1, so the network address OR the wildcard mask—192.168.1.128 OR 0.0.0.63—gives the broadcast address 192.168.1.191.

  4. 4

    Count usable hosts

    6 host bits give 2^6 = 64 addresses. Excluding the network and broadcast addresses leaves 62 usable hosts from 192.168.1.129 to 192.168.1.190.

Enter 192.168.1.130/26 in the calculator above to get exactly these values without calculating them by hand.

Explore more

Related network tools

FAQ

Frequently asked questions about the Subnet Calculator

Quick answers about subnet masks, CIDR notation, host ranges, and conversion to IP ranges.

In CIDR notation, the prefix length follows the slash: with /24, 24 bits belong to the network and 8 bits to the hosts, corresponding to subnet mask 255.255.255.0. For 192.168.1.0/24, the calculator shows network address 192.168.1.0, broadcast address 192.168.1.255, wildcard mask 0.0.0.255, and usable host range 192.168.1.1 to 192.168.1.254—that is 254 usable hosts out of 256 addresses.

The prefix length determines how many bits of the subnet mask are set to 1. For example, /26 gives 255.255.255.192. The network address is the result of a bitwise AND between the IP address and subnet mask; it is the first address in the subnet. To get the broadcast address, set all host bits to 1; it is the last address. The calculator does both as you type and also shows the subnet mask in binary. You can find the full calculation steps further up this page.

The first address identifies the network itself (network address), while the last is reserved for broadcast messages to all devices in the subnet (broadcast address). That is why a subnet normally has two fewer usable host addresses than total addresses. For /31 (point-to-point links under RFC 3021) and /32 (a single host address), these addresses are not reserved, so the calculator counts every address as usable.

The wildcard mask is the inverse of the subnet mask (e.g., 0.0.0.255 instead of 255.255.255.0). It is primarily used in Cisco ACLs (Access Control Lists) and OSPF configurations, where address ranges are defined using wildcard masks rather than subnet masks.

Without “/prefix length”, subnet mode assumes /24 and marks the prefix length as “assumed”. The input field does not accept a subnet mask in dotted-decimal notation; it expects CIDR notation with a prefix length from 0 to 32. Convert the mask first, for example 255.255.255.0 to /24. The subnet mask table on this page can help. In “CIDR ↔ IP Range” mode, however, an address without a prefix is treated as a single address.

In “CIDR ↔ IP Range” mode, the calculator shows the first and last address of a CIDR block and the number of addresses: 192.168.0.0/16 runs from 192.168.0.0 to 192.168.255.255 and contains 65,536 addresses. To convert the other way, enter a start and end address. A range fits into a single block only if it starts and ends on the right boundaries. Otherwise, the converter returns the smallest possible list of CIDR blocks: 10.0.0.5 to 10.0.0.20 produces five blocks that you can copy together.

Partly. “CIDR ↔ IP Range” mode works with 128-bit addresses and shows the exact address count, even for a /64 with 18,446,744,073,709,551,616 addresses. The start and end addresses must both be IPv6; mixing IPv6 and IPv4 is not supported. Subnet mode, with its subnet mask, broadcast address, and host range, is IPv4-only.

Yes. In “CIDR ↔ IP Range” mode, you can download all addresses as TXT (one address per line) or as CSV with a header row. The file is generated directly in your browser, just like the calculation itself: nothing is sent to a server when you calculate. Exports are limited to 1,048,576 addresses, the number in an IPv4 /12 block. An IPv6 /64 therefore cannot be listed; use its start and end addresses instead.

Any more questions?

Contact Support
Planning your own network?

Full control over your own network with a VPS

A ZAP-Hosting VPS gives you full control over your IP addresses and network configuration, without third-party restrictions.

4.4/5 Trustpilot32,000+ Active serversSince 2010

No setup. No risk. Online in seconds.

Flexible TermCancel anytimeOnline in 60 seconds

Looking for more tools? View all network tools