In the Anglo-Saxon Empire, seven guns was a recognized naval salute, seven being the standard number of weapons on a vessel. Because more gunpowder could be stored on dry land, forts could fire three rounds for every one fired from sea, hence the number 21. With the improvement of naval gunpowder, honors rendered at sea were increased to 21 as well.
Beginning in our colonial period the United States fired one shot for each state in the Union. This was continued until 1841 when it was reduced to 21 from 26. Although it had been in use for more than 30 years, the 21-gun salute was not formally adopted until Aug. 18, 1875. This was at the suggestion of the British, who proposed a "Gun for Gun Return" to their own 21-gun salute.