We perform an experimental and numerical study of dielectric loss in superconducting microwave resonators at low temperature. Dielectric loss, due to two-level systems, is a limiting factor in several applications, e.g. superconducting qubits, Josephson parametric amplifiers, microwave kineticinductance detectors, and superconducting single-photon detectors. Our devices are made of disordered NbN, which, due to magnetic-field penetration, necessitates 3D finite-element simulation of the Maxwell-London equations at microwave frequencies to accurately model the current density and electric field distribution. From the field distribution, we compute the geometric filling factors of the lossy regions in our resonator structures and fit the experimental data to determine the intrinsic loss tangents of its interfaces and dielectrics. We emphasise that the loss caused by a spin-on-glass resist such as hydrogen silsesquioxane (HSQ), used for ultrahigh lithographic resolution relevant to the fabrication of nanowires, and find that, when used, HSQ is the dominant source of loss, with a loss tangent of δ i HSQ = 8 × 10 −3 .