About 50 % of cancer patients receive some form of radiation therapy over the course of treatment. The accuracy of external beam radiation therapy relies on careful reference dosimetry, the calibration of treatment machine output. A comprehensive investigation of reference dosimetry of photon and electron beams is presented using measurements and Monte Carlo simulations, with specific focus on the determination of accurate beam quality conversion factors, kQ, which are needed to convert the reading of an ionization chamber calibrated in a cobalt-60 reference field to the absorbed dose to water in a clinical beam. Measurements of kQ factors for plane-parallel chambers are determined as the ratio of absorbed dose calibration coefficients, traceable to the Canadian primary standard water calorimeter, in a cobalt-60 beam to those from linac photon beams. The poor repeatability of these measurements indicates that plane-parallel chambers may not be suitable for reference dosimetry without a cross-calibration procedure. With the EGSnrc code system, kQ factors are calculated as the ratio of the absorbed dose to water and the absorbed dose to the gas in fully modelled ionization chambers in clinical photon and electron beams to that in a cobalt-60 beam. Calculated kQ factors for all chambers are within 0.7 % of those recommended by current dosimetry protocols although individual correction factors, used to explain the differences between kQ factors, are up to 1.7 % different. Systematic uncertainties in calculated kQ factors are less than 0.5 % using realistic assumptions and generally less than 1 % with conservative assumptions. Excellent agreement is observed when comparing the measured kQ factors of this work and from the refereed literature to the present calculated values. This comparison is used to establish that the upper limit of (W/e)air variation with photon beam quality is 0.36 % with 95 % confidence. The level of agreement between measured and calculated kQ factors and the low systematic uncertainties in Monte Carlo calculated kQ factors give great confidence in adopting these calculations for updated reference dosimetry protocols.