We develop sharp upper bounds for energy levels of the magnetic Laplacian on starlike plane domains, under either Dirichlet or Neumann boundary conditions and assuming a constant magnetic field in the transverse direction. Our main result says that n j=1 Φ λ j A/G is maximal for a disk whenever Φ is concave increasing, n ≥ 1, the domain has area A, and λ j is the j-th Dirichlet eigenvalue of the magnetic Laplacian i∇+ β 2A (−x 2 , x 1 ) 2 . Here the flux β is constant, and the scale invariant factor G penalizes deviations from roundness, meaning G ≥ 1 for all domains and G = 1 for disks.