Applications of subwavelength-diameter optical fibres in nonlinear optics require precise knowledge of the submicrometre fibre waist diameter. We demonstrate a new technique for optical measurement of the diameter based on second- and third-harmonic generation with an accuracy of better than 2%. To generate the harmonic light, inter-modal phase matching must be achieved. We find that the phase-matching condition allows us to unambiguously deduce the fibre diameter from the wavelength of the harmonic light. High-resolution scanning electron microscope imaging is used to verify the results.