Home › Programmer & Developer Tools › IPv4 Subnet Calculator

IPv4 Subnet Calculator

Enter an IPv4 address and prefix to get the network and broadcast addresses, usable host range, host count, subnet mask, wildcard mask, CIDR, and IP class.

How to use IPv4 Subnet Calculator

  1. Enter an IPv4 address.
  2. Choose the CIDR prefix or subnet mask.
  3. Read the network, broadcast, and host details.

Frequently asked questions

How are /31 and /32 handled?
/32 is treated as a single host, and /31 as a 2-host point-to-point link (RFC 3021) with no separate network or broadcast address.
How many usable hosts are in a subnet?
For most subnets it is 2^(32−prefix) − 2, subtracting the network and broadcast addresses; /31 and /32 are special-cased.

More Programmer & Developer Tools

  • JSON Validator — Validate, parse, and prettify JSON — load it from a URL or curl command, or convert a Python dict (single quotes, True/False/None) to JSON. Identifies syntax errors with precise line number reporting.
  • Code Beautifier — Automatically format your JavaScript, CSS, and HTML with customizable indentation and style rules.
  • Minifier — Reduce bundle sizes by removing whitespace, comments, and optimizing code structure for production.
  • SQL Formatter & Beautifier — Pretty-print and indent SQL queries across dialects (PostgreSQL, MySQL, T-SQL, BigQuery, and more) with configurable keyword casing.
  • XML Formatter — Beautify and validate XML with configurable indentation, or minify it to the smallest valid output — entirely in your browser.
  • JSON Diff — Compare two JSON objects (or Python dicts) structurally to spot added, removed, and changed keys — or switch to line and word mode for plain text and code.
  • RegEx Tester — Build and test regular expressions in real-time with syntax highlighting and match group visualization.
  • Base64 Converter — Quickly encode and decode strings or files to Base64 format for safe data transmission.