A formula is developed connecting the wingbeat frequency of insects with their masses and wing areas. It is derived first theoretically, using dimensional analysis, and then it is compared with published measurements. The formula discovered involves two parameters which dimensional analysis alone cannot determine. One of these is evaluated using one among many proposed semi-empirical relationships (the only one that stands scrutiny); the other by fitting a published dataset. It is found that the resulting equation, applying to insects in general, accords well with observation, and indeed is very close to being optimal (in a sense to be defined).