In World War 2 there were three main types of weapons to shoot down enemy aircraft. Some of these were far more powerful than others. They could also be used only at certain times depending on how high a plane was because they had various ranges. Some were well equipped for aircraft of different speeds and sizes.
The first type are heavy machine guns. Heavy machine guns had a caliber of at least .50 but less than 20mm. They would be great for engaging low flying aircraft and because of their rapid fire could be aimed at fast aircraft as well. They were not as effective against heavy aircraft like bombers. Bombers were too massive and often flew too high for these guns. These guns could and would also be used against infantry and unarmored or lightly armored ground vehicles. Some examples include the American .50 M2 and Soviet 12.7mm DShK. American M2s would often be mounted on various vehicles such as tanks, half-tracks and armored cars. Sometimes even regular jeeps would have them.
The second type are anti-aircraft autocannons. These are 20mm or heavier but usually no more than 40mm. They would fire at a rate almost as fast as heavy machine guns. They were more powerful and could have an explosive shell. They also had a higher firing range so could reach aircraft at much higher altitudes but could not reach certain aircraft such as the B-29 Superfortress when it was flying at it’s maximum height. They could also be used against lightly armored vehicles and infantry. Some examples include the Swedish 40mm Bofors used by most of the Western Allies, German 2.cm flak 30/38 and and Japanese 25mm type 96.
American .50 caliber M2 Browning heavy machine gun
The third type are called anti-aircraft cannons. They were the largest in size and the size of the round fired. They were not automatic. They would often be set to explode at a certain altitude to have a better chance of causing damage. Planes could not fly high enough to avoid the range of these guns. These guns were the most effective at taking down bombers or cargo planes especially when they flew in large formations. One direct shot from these could destroy any plane by touching any part. Even the explosion of a shell in midair could destroy the plane if it was very close. They were so powerful that most could also be used to destroy heavy tanks at regular ranges. However faster and more maneuverable planes would be harder to hit. Also these were generally smaller targets. Some examples include the German 8.8cm flak gun, American 90mm M1, and Soviet 85mm M1939 (52-k).
Swedish 40mm Bofors anti-aircraft auto-cannon
All of these guns were deadly and were used best for certain targets. The guns with larger rounds were also heavier and less easy to transport at a moments notice. For example heavy machine guns could be carried by just two men, one for the gun and the other for the tripod. The others would need horses or vehicles to move them. Also they could all work against not only aircraft but infantry and various ground vehicles. For example heavy machine guns could penetrate light armor at most but anti-aircraft cannons could even destroy heavy tanks.
German 88mm FLAK 36 anti-aircraft cannon