Answer:
Calculating a subnet mask depends on whether you are using the default, classful mask or a true subnet mask to divide a network into smaller pieces.
The defaults are on octet boundaries (every 8 bits):
255.0.0.0 class A network
255.255.0.0 class B network
255.255.255.0 class C network
Any other type of subnet mask with 4 octets (iPV4) can use combinations of those with any octet value from 0 - 255. No number may be larger than 255.
Calculating other subnet masks would be based on how many subnets you want in the network. You could have values such as:
255.192.0.0
255.255.248.0.0
255.255.255.252
The first octet must at least be 255. The other octets may change, based on whether it is a classful default network or it is being subnetted.