We derive a microscopic expression for a quantity μ that plays the role of chemical potential of active Brownian particles (ABPs) in a steady state in the absence of vortices. We show that μ consists of (i) an intrinsic chemical potential similar to passive systems, which depends on density and self-propulsion speed, but not on the external potential, (ii) the external potential, and (iii) a newly derived one-body swim potential due to the activity of the particles. Our simulations on ABPs show good agreement with our Fokker–Planck calculations, and confirm that is spatially constant for several inhomogeneous active fluids in their steady states in a planar geometry. Finally, we show that phase coexistence of ABPs with a planar interface satisfies not only mechanical but also diffusive equilibrium. The coexistence can be well-described by equating the bulk chemical potential and bulk pressure obtained from bulk simulations for systems with low activity but requires explicit evaluation of the interfacial contributions at high activity.