plain/devtools home

CIDR calculator

Enter a CIDR block such as 10.0.0.0/16 or 2001:db8::/32 to see its range, mask and size.

tool 11 of 12 []
all shortcuts ?

cidr-calculatorsamplesCtrl↵ run · s sample

Is an IP inside this block?

Split into smaller subnets

never leaves your browser

How to use it

  1. Type an address and prefix length. The address does not have to be the network address; 192.168.10.77/26 is normalised to the block 192.168.10.64/26 and the tool tells you so.
  2. For IPv4 you get the netmask, wildcard mask, network and broadcast addresses, first and last usable host and the usable host count. /31 and /32 follow the usual point-to-point and single-host rules.
  3. IPv6 blocks show the network, last address and total address count. IPv6 has no broadcast address.
  4. Use the membership check to test whether one address falls inside the block, and Split to list the subnets of a longer prefix.

Examples

Select an example to load it into the tool.

  • /24 LAN192.168.1.0/24
  • Private 10/810.0.0.0/8
  • AWS style VPC /16172.31.0.0/16
  • IPv6 /482001:db8:abcd::/48
  • Point-to-point /3110.1.1.4/31

Frequently asked questions

How many usable hosts does a /24 have?

254. A /24 has 256 addresses; the first is the network address and the last is the broadcast address, which are not assigned to hosts. The formula is 2^(32 - prefix) minus 2.

Why does a /31 or /32 not follow that formula?

A /31 has two addresses and RFC 3021 allows both to be used on point-to-point links. A /32 is a single host address, as used for loopbacks and host routes.

What is a wildcard mask?

The bitwise inverse of the netmask. Cisco ACLs and OSPF network statements use it: a /24 netmask 255.255.255.0 becomes wildcard 0.0.0.255.

Does it support IPv6?

Yes. It parses abbreviated forms (::), IPv4-mapped tails and prints results in compressed RFC 5952 form. Counts use exact big-integer arithmetic, so a /32 correctly shows 79228162514264337593543950336 addresses.

Are cloud providers different?

Many clouds reserve extra addresses in each subnet. AWS, for instance, reserves five in every subnet, so usable hosts are fewer than this tool shows. Check your provider's documentation.

Related tools

esc
↑↓ move↵ open? all shortcuts

Keyboard shortcuts

Cmd or Ctrl shortcuts always work.
Everywhere
Everywhere
Open the command palette
CtrlK
Open the palette (outside a text field)
/
Show these shortcuts
?
Toggle light and dark theme
t
Go home
gh
Go to all tools
gt
On a tool page
On a tool page
Run the main action
Ctrl↵
Copy the output
c
Load the next sample
s
Focus the input
i
Leave a text field
Esc
Previous or next tool
[]
In the palette
In the palette
Move the selection
↑↓
Open the selected item
↵
Close
Esc