It seems to me 20mm cannons do much more damage than the same amount of 50cal bullets.
But I'm a terrible shot.
Even leaving aside the explosive content, a Browning .50 cal has about 17,000 joules of energy at the muzzle where a Hispano Mk II has about 49,500 joules at the muzzle.
The US Navy also concluded that a single Hispano II (M2 20mm cannon in US service) had as much firepower as a bank of three Browning .50 cals. That isn't one 20mm round being worth three 50 cal rounds, it is one cannon at 10 rounds per second being worth three guns at 36 rounds per second.