The power calculation approach to the determination of sample size for comparing two independent means and two independent proportions in cross-sectional surveys, cohort studies, case-control studies, clinical trials and community trials is developed. These formulae are inverted to produce expressions for power given sample size and minimum detectable relative risk (or in the case of means, minimum detectable difference) given power and sample size. Although the basic methodology of the approach is well known it is shown that various approximations are necessary in the case of proportions, and the particular approximation used determines the formula obtained. Case-control studies require special formulae of their own. Allowance for unequal sample sizes in the groups to be compared is used throughout. A discussion of the procedures used by the statistical package INSTAT to calculate sample size is included.