Schwarz studied chemistry at Berlin, but Kummer and Weierstrass influenced him to change to mathematics. Schwarz attended Weierstrass's lectures on the integral calculus in 1861, and the notes that Schwarz took at these lectures still exist.

Schwarz received his doctorate, which was supervised by Weierstrass, from the University of Berlin in 1864, and was appointed to the University of Halle in 1867. In 1869 he was appointed to a chair at Zurich and in 1875 to chair at Göttingen. Schwarz succeeded Weierstrass at Berlin in 1892 teaching there until 1917.

His marriage was a mathematical one since he married Kummer's daughter. Outside mathematics, he was the captain of the local Voluntary Fire Brigade and he assisted the stationmaster at the local railway station by closing the doors of the trains.

Schwarz worked on the conformal mappings of polyhedral surfaces onto the spherical surface. His alternative procedure for solving the Dirichlet problem soon became a standard technique. He also worked on minimal surfaces, a characteristic problem of the calculus of variations.

His most important work was for Weierstrass's 70th birthday. Schwarz answered the question of whether a given minimal surface really yields a minimal area. The ideas in this work led Emile Picard to his existence proof for solutions of differential equations. It also contains the inequality for integrals now known as the Schwarz inequality.