The energy from a source was rearranged through reflection or refraction by a freeform optical element in order to get the desired uniform illumination. The numerical results of first-order partial differential equation sets had been investigated to obtain the freeform optical element, and the equations could be used to get the characteristics of the light source and the desired illumination. For example, a light emitting diode (LED) with a Lambertian light emitting surface of 1 mm61 mm was applied as the light source. Two kinds of freeform reflectors and one freeform lens were designed for different illuminations, and the simulated uniformity was near to 90%. Considering the size of these freeform optical elements, the illumination system can be very compact and efficient if the freeform optical element is applied in the illumination system of projectors with LED as source.