Mixing iodide and bromide in halide perovskite semiconductors is an effective strategy to tune their bandgap, therefore mixed-halide perovskites hold great promise for color-tunable LEDs and tandem solar cells. However, the bandgap of mixed-halide perovskites is unstable under (sun-)light, since the halides segregate into domains of different bandgaps. Using pressure-dependent ultrafast transient absorption spectroscopy, we show that high external pressure increases the range of thermodynamically stable halide mixing ratios. Chemical pressure, by inserting a smaller cation, has the same effect, which means that any iodide-to-bromide ratio can be thermodynamically stabilized by tuning the crystal volume and compressibility. We interpret this stabilization by an alteration of the Helmholtz free energy via the largely overlooked PdeltaV term.