# CIDR Calculator

> Split an IPv4 CIDR into network, broadcast, netmask, wildcard, and usable host range. Paste 10.0.0.0/8 or 192.168.1.20/24. The math stays in the browser. There is no IP lookup.

Runs in your browser. Nothing is uploaded.

[Ops](https://toolbuddy.dev/categories/ops.md)

## About this tool

Split an IPv4 CIDR such as 192.168.1.10/24 into the network address, broadcast, netmask, wildcard mask, and usable host range. Prefixes /31 and /32 follow the point-to-point and single-host cases, so every address in the block counts as a host.

How to use: type an address and a prefix from 0 to 32. Copy the summary from the sticky bar. A host address is masked down to the network, so 192.168.1.10/24 and 192.168.1.0/24 describe the same block.

Example: 10.0.0.0/8 is network 10.0.0.0, netmask 255.0.0.0, and broadcast 10.255.255.255. 172.16.5.4/32 is a single host. 10.1.1.0/31 has two usable addresses.

The arithmetic stays in the tab. This does not look up your public IP, geolocate an address, or upload the CIDR. Related: the IPv4 converter for dotted, integer, hex, and binary forms of one address.

## FAQ

### Why does a /31 show two usable hosts?

Prefixes /31 and /32 treat every address in the block as a host. A /31 is the point-to-point case, with two addresses and no reserved network or broadcast. Wider prefixes reserve those two addresses, so usable hosts are the block size minus two.

## Related Ops tools

- [Gitignore Generator](https://toolbuddy.dev/tools/gitignore-generator.md): Build a .gitignore from stacked templates for Node, Python, Go, Rust, Java, Next.js, macOS, and Windows. Output is composed locally.
- [.env Toolkit](https://toolbuddy.dev/tools/env-toolkit.md): Parse KEY=value env files, flag duplicates, and diff two .env blobs. Secrets in env files never leave the browser.
- [Docker Generator](https://toolbuddy.dev/tools/docker-generator.md): Generate a Dockerfile or a Compose service snippet from image, ports, and command fields. Snippets are built in the tab.
- [GitHub Actions Explainer](https://toolbuddy.dev/tools/github-actions-explainer.md): Explain a GitHub Actions workflow YAML: name, triggers, jobs, and steps. Parsing uses js-yaml in the browser.
- [cURL Generator](https://toolbuddy.dev/tools/curl-generator.md): Build a curl command from method, URL, headers, and body. The command is assembled locally so tokens in headers stay in the tab.
- [Tar Command Generator](https://toolbuddy.dev/tools/tar-generator.md): Build a tar create or extract command with gz, bz2, or xz flags. A small command helper, not an archiver.
