This paper presents a magnetic gravity compensator, which is able to provide compensation about two axes of rotation for mobile arm support systems. Because of the compensation about two axes, it provides more flexibility than the existing mechanical gravity compensators. This flexibility is achieved by using two semispherical permanent magnets, where the inner semisphere can rotate about the x-, y-, and z-axis with respect to the outer semisphere. Several magnetization topologies, which are evaluated using 2-D finite-element analysis (FEA), are investigated, and the most suitable topology is optimized in 2-D FEA. The optimization results are verified with 3-D FEA