The funny thing about a JavaScript Subnet Calculator is that JavaScript integers are only 16 bit
[1]. In order to do easy bit shifting you need 32 bit integers. This code weaves it's way through that issue by storing IP address octets in arrays with 4 integers.
View source to see/grab the code.
You can use
CIDR Netmask in the Network IP field (eg:10.0.0.1/24). Change the network class, network IP, subnet mask, or number of hosts to trigger calculations. This code does work on most browsers including Chrome
, FireFox
, Safari
, Opera
, Android
, iPhone
, iTouch
, Blackberry
and even Edge
& IE
.