A symmetry breaking (SB) involves an abrupt change in the set of microstates that a system can explore. This change has unavoidable thermodynamic implications. According to Boltzmanns microscopic interpretation of entropy, a shrinkage of the set of compatible states implies a decrease of entropy, which eventually needs to be compensated by dissipation of heat and consequently requires work. Examples are the compression of a gas and the erasure of information. On the other hand, in a spontaneous SB, the available phase space volume changes without the need for work, yielding an apparent decrease of entropy. Here we show that this decrease of entropy is a key ingredient in the Szilard engine and Landauers principle and report on a direct measurement of the entropy change along SB transitions in a Brownian particle. The SB is induced by a bistable potential created with two optical traps. The experiment confirms theoretical results based on fluctuation theorems, allows us to reproduce the Szilard engine extracting energy from a single thermal bath, and shows that the signature of a SB in the energetics is measurable, providing new methods to detect, for example, the coexistence of metastable states in macromolecules.