Temperature gradient focusing (TGF) is a highly efficient focusing technique for the concentration and separation of charged analytes in microfluidic channels. The design of an appropriate temperature gradient is very important for the focusing efficiency. In this study, we proposed a new technique to generate the temperature gradient. This technique utilizes a microchannel filled with liquid-metal as an electrical heater in a microfluidic chip. By applying an electric current, the liquid-metal heater generates Joule heat, forming the temperature gradient in the microchannel. To optimize the temperature gradient and find out the optimal design for the TGF chip, numerical simulations on four typical designs were studied. The results showed that design 1 can provide a best focusing method, which has the largest temperature gradient. For this best design, the temperature is almost linearly distributed along the focusing microchannel. The numerical simulations were then validated both theoretically and experimentally. The following experiment and theoretical analysis on the best design also provide a useful guidance for designing and fabricating the liquid-metal based TGF microchip.