During the formation stage of the Earth, release of gravitational energy results in global melting and formation of a magma ocean. Thermal and chemical evolution of the magma ocean is examined based on a one-dimensional two phase flow model. The following results are obtained. When a magma ocean is vigorously convecting, chemical differentiation occurrs at the intermediate melt fraction (20-30%) because of large viscosity change. The magma ocean is kept just at the melt fraction, at which the differentiation proceeds most rapidly. Hence, chemical differentiation in the magma ocean seems to be inevitable, if density and composition difference exist between solid and melt. Chemical differentiation is controlled by composition difference of melt and solid phases at intermediate melt fraction rather than those at liquidus or solidus. Moreover, the resulted elemental distribution does not always reflect difference of partition coefficients.