A method of determining the field distribution within an optical fiber of arbitrary refractive index profile using near-field scanning optical microscopy is described. The 3D intensity distribution emerging from the end of a cleaved fiber is measured by scanning a subwavelength aperture through the distribution, and the field within the fiber is inferred from this information. In the case of a single-mode step-index fiber, results are found to agree with a Gaussian modal distribution.