Over 50% of the energy from power plants, vehicles, oil refining, and steel or glass making process is released to the atmosphere as waste heat. As an attempt to deal with the growing energy crisis, the solid-state thermoelectric generator (TEG), which converts the waste heat into electricity using Seebeck phenomenon, has gained increasing popularity. Since the figures of merit of the thermoelectric materials are temperature dependent, it is not feasible to achieve high efficiency of the thermoelectric conversion using only one single thermoelectric material in a wide temperature range. To address this challenge, this paper proposes a method based on topology optimization to optimize the layouts of functional graded TEGs consisting of multiple materials. The objective of the optimization problem is to maximize the output power and conversion efficiency as well. The proposed method is implemented using the Solid Isotropic Material with Penalization (SIMP) method. The proposed method can make the most of the potential of different thermoelectric materials by distributing each material into its optimal working temperature interval. Instead of dummy materials, both the P and N-type electric conductors are optimally distributed with two different practical thermoelectric materials, namely Bi2Te3 & PbTe for P-type, and Bi2Te3 & CoSb3 for N-type respectively, with the yielding conversion efficiency around 12.5% in the temperature range Tc = 25°C and Th = 400°C. In the 2.5D computational simulation, however, the conversion efficiency shows a significant drop. This could be attributed to the mismatch of the external load and internal TEG resistance as well as the grey region from the topology optimization results as discussed in this paper.