The general rule for the Glocks with the exception of the 36.
A magazine from a larger model will fit into a smaller model of the same caliber.
The new magazines with the exposed metal rectangle on the front of the magazine will work an older Glock but the older magazines will not work in the ambidextrous mag release pistols.