The partitioning of K and Na between liquid Fe–S–O alloys and silicate melt has been determined over the pressure and temperature range 2.5–24 GPa and 1500–1900°C. In experiments with S-free Fe alloys, the alkali elements show completely lithophile behaviour. When S is added, however, K and Na begin to enter the Fe-liquid phase and their distribution coefficients DI (=[I]metal/[I]silicate) correlate strongly with O content (and FeO activity) of the Fe–S–O liquid and with the composition of the silicate melt. For potassium, DK is ∼1.0 for Fe–sulphide liquid containing 30% S and 8% O. Increasing temperature leads to increasing O solubility in the Fe–sulphide liquid and correspondingly higher values of DK. Increasing pressure on the other hand slightly reduces DK values. Given a planetary core containing 10 wt% S and 4–8 wt% O, then several hundred ppm K would be present in the Fe–sulphide liquid if it segregated at low pressures, e.g. in a small planetary body such as Mars. If, as has recently been suggested, the Earth’s core separated at the base of a deep magma ocean, then its highest possible K content is about 250 ppm. The latter would generate approximately 20% of the total heat production of the core. K can only be present in the core, however, if, at some time during its formation, a discrete O-rich FeS liquid separated from the silicate mantle. Finally, the sulphide compositions produced in our experiments imply that a combination of S and O could contribute significantly to the light element content of the Earth’s core.