Skip to content
Marvin's Toolbox.

Search tools

Type to filter all tools

IP Subnet Calculator

Work out an IPv4 or IPv6 network from an address with a prefix or netmask: network and broadcast addresses, usable host range, subnet mask, wildcard mask and address type. Adjust the prefix with a slider, read the binary breakdown, and split the network into smaller subnets.

Everything runs locally in your browser. Your data never leaves your device.

IPv4 or IPv6, with an optional prefix like /24 or a netmask like 255.255.255.0.

Nothing to calculate yet
Type an IP address above, or try one of the examples, to see its network, masks, host range and more.

About the IP Subnet Calculator

This tool takes an IP address with a prefix or netmask and works out the whole network around it. Type 192.168.1.42/24 and you get the network and broadcast addresses, the range of usable hosts, the subnet mask and wildcard mask, what kind of address it is, and the address in binary with the network bits highlighted.

It reads IPv4 and IPv6. For IPv4 you can give the size as a CIDR prefix like /24 or as a dotted netmask like 255.255.255.0, and non-contiguous masks are rejected with a clear message. For IPv6 you get the compressed and fully expanded forms of the address, the first and last address of the network, and address counts written as powers of two, since numbers like 2^64 are easier to reason about than twenty digits.

What you can do

  • Find the network address, broadcast address and usable host range of a subnet.
  • Convert between a CIDR prefix and a dotted subnet mask.
  • Get the wildcard mask for router ACLs.
  • Resize a network by dragging the prefix slider and watch every value update.
  • Split a network into smaller equal subnets and copy the list.
  • Expand or compress an IPv6 address.
  • Check whether an address is private, public, loopback, link-local or another special range.
  • See the reverse DNS pointer name for an address.

How to use the IP Subnet Calculator

  1. 1Type an IP address, alone or with a prefix like /26 or a netmask.
  2. 2Read the summary cards and the detail rows, each value has its own copy button.
  3. 3Drag the prefix slider to grow or shrink the network and compare the results.
  4. 4Pick a new prefix under the split section to divide the network into smaller subnets.

How subnet math works

An IPv4 address is 32 bits and the prefix says how many of them, counted from the left, name the network. The rest name hosts inside it. A /24 leaves 8 host bits, so the network spans 256 addresses. The first one is the network address and the last one is the broadcast address, and neither can be assigned to a machine, which is why a /24 has 254 usable hosts. The binary breakdown in the tool shows exactly this split, with the network bits highlighted.

Two prefixes are special. A /31 holds just two addresses and, per RFC 3021, both are usable, because point-to-point links between routers need no broadcast. A /32 is a single host route.

IPv6 differences

IPv6 has no broadcast address and no netmask notation, the prefix length is the only way to write a network size. Every address in a network is assignable, so the tool reports the first and last address instead of a host range. Networks are also enormous: the standard subnet size is a /64, which holds 2^64 addresses. The same address can be written many ways, so the tool shows both the RFC 5952 canonical short form and the fully expanded form.

Special address ranges

Not all addresses are ordinary public space. The tool recognises the special-use ranges from the IANA registries and names them: the RFC 1918 private ranges (10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16), loopback, link-local, carrier-grade NAT, multicast, the documentation ranges, and for IPv6 the unique local, link-local, IPv4-mapped and Teredo ranges among others. This is a quick way to check whether an address should ever appear on the public internet.

Convert numbers between binary, octal, decimal, hexadecimal and any base up to 36. Type into any field and the others update as you go. Handles huge integers without losing precision and accepts 0x, 0b and 0o prefixes.

Decode Base64 to text or encode text to Base64. Paste into the top box, read the result below, and flip the direction with one click. Handles Unicode correctly and reads URL-safe Base64 too.

See what your clipboard really holds. One press lists every format on it, from plain text and HTML to Excel tables and images, each with its type, size and a preview. Pasting works too, and can reveal even more formats.

Check two colors against the WCAG contrast rules. Type or pick a text and a background color, read the contrast ratio, see which AA and AAA checks pass, preview real text at the sizes WCAG distinguishes, and get suggested fixes when a check fails.

Convert a color between HEX, RGB, HSL, HSV, HWB, CMYK, OKLCH and OKLAB. Type into any field and the others update as you go, or pick the color visually. Reads CSS color syntax and keeps alpha where the format supports it.

Convert config and data between JSON, YAML, TOML, JSON5, INI, XML, CSV and .env. Type or paste on the left, pick the output format on the right, and copy the result. Includes a format button and a minify toggle.