Subnet Calculator
Enter an IP and CIDR prefix or subnet mask to instantly get network, broadcast, host range, and mask details.
Privacy: your files never leave your device. All processing happens locally in your browser.
How to use
- 1.Type an IPv4 address such as 192.168.1.10 into the address field.
- 2.Choose CIDR prefix (for example /24) or switch to Subnet mask and enter one like 255.255.255.0.
- 3.Read the results table: network and broadcast addresses, the first and last usable host, usable and total host counts, subnet and wildcard masks, IP class, and RFC 1918 private status update instantly.
About Subnet Calculator
This subnet calculator turns an IPv4 address plus a CIDR prefix (like /24) or a dotted subnet mask (like 255.255.255.0) into everything you need to plan or troubleshoot a network — the network address, broadcast address, first and last usable host, total and usable host counts, subnet mask, wildcard mask, IP class, and whether the address is private under RFC 1918.
CIDR notation (RFC 4632) replaced the old fixed Class A/B/C boundaries: the number after the slash is how many leading bits identify the network, so /24 means 24 network bits and 8 host bits. The subnet mask is that same split written as four octets, and the wildcard mask — the mask's bit-for-bit inverse — is what access-control lists and OSPF use to match address ranges.
The network address is the first address in the block (all host bits zero) and the broadcast address is the last (all host bits one); neither can be assigned to a device, which is why usable hosts equals 2^(host bits) − 2. A /24 therefore gives 256 total addresses but 254 usable ones.
Two prefixes break that rule, and the calculator handles both. A /31 (RFC 3021) is meant for point-to-point links: with only two addresses, both are usable hosts and there is no separate network or broadcast address, giving 2 usable hosts instead of 0. A /32 describes a single host — network, broadcast, and host are the same address — so it reports 1 usable host, which is how loopbacks and single-host firewall rules are written.
Private ranges (RFC 1918) — 10.0.0.0/8, 172.16.0.0/12, and 192.168.0.0/16 — are the blocks reserved for internal use behind NAT and never routed on the public internet, so knowing whether your address is private matters before you expose a service.
Everything is computed with 32-bit unsigned bitwise math in your browser; no address or query ever leaves your device.
Methodology & sources
IPv4 subnetting per RFC 950 / RFC 4632 (CIDR); point-to-point /31 per RFC 3021; private ranges per RFC 1918. Network = IP AND mask, broadcast = network OR wildcard, usable hosts = 2^(32-prefix) - 2 for prefixes up to /30. All computed with 32-bit unsigned bitwise math client-side.
Frequently asked questions
- Why does a /24 have 254 usable hosts instead of 256?
- A /24 has 256 total addresses, but the first (the network address) and the last (the broadcast address) are reserved and cannot be assigned to devices. That leaves 2^8 − 2 = 254 usable host addresses.
- How many usable hosts are in a /31 or /32?
- A /31 has 2 usable hosts. Under RFC 3021 it is used on point-to-point links where both addresses are valid hosts and there is no network or broadcast address. A /32 has 1 usable host — it describes a single address, so the network, broadcast, and host are all identical.
- What is the wildcard mask used for?
- The wildcard mask is the bit-for-bit inverse of the subnet mask (for /24 that is 0.0.0.255). It is used in Cisco access control lists and OSPF network statements to match a range of addresses, where a 1 bit means 'any value here' and a 0 bit means 'must match'.
Related tools
- JSON FormatterFormat, minify, and validate JSON in your browser — pretty-print or compress with pinpoint error locations.
- Diff CheckerCompare two texts line by line and see exactly what was added, removed, or unchanged — in your browser.
- UUID GeneratorGenerate cryptographically random RFC 4122 v4 UUIDs in bulk — copy one or all, in your browser.
- ANSI Color Codes GeneratorBuild and copy raw SGR escape sequences and search the standard 8 plus bright 8 terminal color codes.
- ASCII TableLook up every standard 7-bit ASCII code with exact decimal, hexadecimal, octal, and binary values.
- Badge GeneratorBuild a Shields.io badge URL, Markdown snippet, and HTML image tag without memorizing path escapes or query parameters.
Developer Tools guides
View all- How to Calculate a Subnet in a Network: Full Method
- How to Calculate Subnet Block Size: Formula and CIDR Table
- How to Calculate Subnet Bits From an IP and Mask
- How to Edit an HTML Page Online Without Software
- An HTML Cleaner Alternative Built on the Browser Parser
- Hello World API Alternative for 12 Programming Languages
- Remove Excel Link From PPT Chart: Audit the Workbook
- How to Make Flexbox in HTML: Build a Container Block
- File Signatures List Cheat Sheet: Match Twelve Magic Bytes
- View Excel Online History Without Uploading
- How to Convert Excel to JSON in Python and Locally
- Convert an XLSX Worksheet to an HTML Table Snippet
- Excel Formulas Cheat Sheet Example: 12 Verified Formulas
- Get an Excel Column Total From a Local xlsx File
- How to Generate a Dummy File With Exact Bytes
- How to Get a Directory Tree in Mac Terminal
- Camel Case to Snake Case: Command Line vs Online Tool
- CSV to JSON Command Line vs Online: A Practical Comparison
- Convert CSV to HTML Table for Power Automate: Safer Steps
- How to Convert CSV to Excel Without Losing Data