Several "Armalite" series weapons such as the M4, M16A1 - A4, various carbine version of the M4 and M16, sniper versions of the M16 such as the SPR.. all take the same magazine both in real life and in airsoft. This applies to both 30rnd style mags (banana mags) and 20rnd "VN" style mags. The two are interchangeable. You will find these weapons refered to as "Armalite" which is just a blanket statement for any weapon based off an m16 platform.
Although as previously stated, depending on the AEG manufacturer and the magazine manufacturer, some interchangeability problems may arise.
"Hokey religions and ancient weapons are no match for a good blaster at your side" - Han Solo
Commanding in Airsoft