Partition coefficients define how a solute is distributed between two immiscible phases at equilibrium. The experimental estimation of partition coefficients in a complex system can be an expensive, difficult, and time-consuming process. Here a computational strategy to predict the distributions of a set of solutes in two relevant phase equilibria is presented. The octanol/water and octanol/air partition coefficients are predicted for a group of polar solvents using density functional theory (DFT) calculations in combination with a solvation model based on density (SMD) and are in excellent agreement with experimental data. Thus, the use of quantum-chemical calculations to predict partition coefficients from free energies should be a valuable alternative for unknown solvents. The obtained results indicate that the SMD continuum model in conjunction with any of the three DFT functionals (B3LYP, M06-2X, and M11) agrees with the observed experimental values. The highest correlation to experimental data for the octanol/water partition coefficients was reached by the M11 functional; for the octanol/air partition coefficient, the M06-2X functional yielded the best performance. To the best of our knowledge, this is the first computational approach for the prediction of octanol/air partition coefficients by DFT calculations, which has remarkable accuracy and precision.