We report on the origin of fragmentation of ultracold atoms observed on a magnetic film atom chip. Radio frequency spectroscopy and optical imaging of the trapped atoms is used to characterize small spatial variations of the magnetic field near the film surface. Direct observations indicate the fragmentation is due to a corrugation of the magnetic potential caused by long range inhomogeneity in the film magnetization. A model which takes into account two-dimensional variations of the film magnetization is consistent with the observations. PACS numbers: 03.75. Be, 07.55.Ge, 34.50.Dy, 39.25.+k An atom chip is designed to manipulate magnetically trapped ultracold atoms near a surface using an arrangement of microfabricated wires or patterned magnetic materials [1]. Since the realization of Bose-Einstein condensates (BECs) on atom chips [2,3], pioneering experiments have studied single-mode propagation along waveguides [4], transport and adiabatic splitting of a BEC [5] and recently on-chip atom interferometry [6,7]. Permanent magnets are particularly attractive for atom chips as they can provide complex magnetic potentials [8] while suppressing current noise that causes heating and limits the lifetime of trapped atoms near a surface [9]. To date, permanent magnet atom chips have been developed with a view to study one-dimensional quantum gases [10,11,12], decoherence of BEC near surfaces [9,13], hybrid magnetic and optical trapping configurations [14], and self biased fully permanent magnetic potentials [15]. It has been found, however, that in addition to current noise, atom chips have other limitations, as undesired spatial magnetic field variations associated with the current-carrying wires or magnetic materials act to fragment the trapped atoms.In previous work, fragmentation of atoms trapped near current-carrying wires was traced to roughness of the wire edges that causes tiny current deviations [16,17]. This introduces a spatially varying magnetic field component parallel to the wire which corrugates the bottom of the trap potential. While more advanced microfabrication techniques have been used to produce wires with extremely straight edges, thereby minimizing fragmentation [18,19], the first experiments with permanent magnet atom chips have now also indicated the presence of significant fragmentation [12,20,21]. This has motivated further work towards understanding the mechanisms that cause fragmentation near magnetic materials.In this paper we report on the origin of fragmentation near the surface of a permanent magnetic film atom chip. To characterize the magnetic field near the film surface * Electronic address: brhall@swin.edu.au we have developed a technique which combines precision radio frequency (rf) spectroscopy of trapped atoms with high spatial resolution optical imaging. This allows sensitive and intrinsically calibrated measurements of the magnetic field landscape to be made over a large area. We find the fragmentation originates from long range inhomogeneity in the film magnetization and ha...