A new direct method for the determination of chemical potentials from molecular dynamics simulations is proposed. This paper focuses on development and testing of the method for binary mixtures of Lennard-Jones fluids. The proposed method uses a semipermeable membrane to mimic an osmotic experiment. The excess chemical potential is obtained directly from the osmotic pressure that develops across the membrane and the equilibrium mole fraction of the component to which the membrane is permeable. The method is capable of accurate determination of the chemical potential of either component in the mole fraction range 0.2 < x(i) < 1. The Gibbs-Duhem equation can be used in conjunction with the individual component simulations in the above range to obtain the chemical potentials and the excess free energy over the entire composition range. The new method was tested for Lennard-Jones mixtures of various size and energy ratios by direct comparison of chemical potentials and excess free energies obtained from the osmotic simulations with values available in the literature which were obtained using other methods.