Subnet Calculator API

Subnet Calculator
About

API version: 1.1

The Subnet Calculator allows you to determine network details for an IPv4 subnet, given an address in dotted-decimal notation (w.x.y.z) or CIDR notation (w.x.y.z/s).

Usage

Send a GET request to /api/ip/:ip_address?/:subnet_bits? to get information about the subnet.

Example - Browser:

https://networkcalc.com/api/ip/10.0.1.15/27?binary=1

Example - cURL:

curl https://networkcalc.com/api/ip/10.0.1.15/27

Example - PowerShell:

(Invoke-RestMethod https://networkcalc.com/api/ip/10.0.1.15/27).address

Filter the results by listing the fields you want returned:

?fields=cidr_notation,subnet_mask - or - ?fields=[cidr_notation,subnet_mask]

Include ?binary=1 to include binary representations of the calculated CIDR block.

Results
Name Type Description
status string The status of the request.
'OK' is a good request.
'NO_ADDRESS_SPECIFIED' means you did not specify an address. Assumes '192.168.1.1/24'.
'INVALID_ADDRESS' means the request is malformed.
meta JSON object Information about the request and/or response.
meta.permalink string A hyperlink to the browser results for the calculated subnet.
meta.next_address string The IP address that occurs immediately following the requested address, regardless of subnet.
Useful for iterating over addresses.
address JSON object Information about the address and subnet.
address.cidr_notation string The requested address in CIDR notation (per RFC 4632).
address.subnet_bits number The number of bits representing the subnet mask.
address.subnet_mask string The subnet mask in dotted-decimal notation.
address.wildcard_mask string The wildcard (inverted subnet) mask in dotted-decimal notation.
address.network_address string The network address for the subnet (first address, unassignable).
address.broadcast_address string The broadcast address for the subnet (last address, unassignable).
address.assignable_hosts number The number of assignable hosts in the subnet.
address.first_assignable_host string The IP address representing the first assignable host. null if no such host exists.
address.last_assignable_host string The IP address representing the last assignable host. null if no such host exists.
address.binary JSON Object (Optional) An object representing the same values in binary. Only included if '?binary=1|y|yes|true' is included in the request URL.
Sample Output
GET
https://networkcalc.com/api/ip/10.5.1.0/27?binary=true
GET
https://networkcalc.com/api/ip/10.5.1.0/27?binary=true&fields=[network_address,broadcast_address]