A convenient method using a commercially available ruled grating for precise and overall diameter measurement of optical nanofibers (ONFs) is presented. We form a composite Bragg reflector with a micronscale period by dissolving aluminum coating, slicing the grating along ruling lines, and mounting it on an ONF. The resonant wavelengths of high-order Bragg reflections possess fiber diameter dependence, enabling nondestructive measurement of the ONF diameter profile. This method provides an easy and economic diagnostic tool for wide varieties of ONF-based applications.