subnet calculator @ thaemlitz.com

javascript subnet calculator

The funny thing about a JavaScript Subnet Calculator is that JavaScript integers are only 16 bit. 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 FireFox, Safari, iPhone, iTouch, Android, Blackberry and even IE.

Class A B C
Network IP
Subnet Mask
Wildcard Mask
Mask Bits
Hosts
Subnet ID
Start
End
Broadcast
Bitmap

if you have suggestions or comments, feel free to post them in our guest book.