Lithiation, sodiation, and magnesiation of black phosphorus are clarified and compared using first-principles calculations.