The article presents the optimization of the power density of a thermoelectric generator (TEG) operating in cryogenic temperature conditions. Optimization of TEG power density was performed as a function of TEG leg length and its effect on TEG performance. The figure of merit (ZT) of the TEG was experimentally verified for the temperature range of a cold sink from 160 to 250 K, which corresponds to the temperature of the wall subjected to the boiling film of LNG. The numerical model proposed in the article was verified by comparison with experimental data, and then used to simulate the operation of the TEG at a cold sink temperature of 80 K corresponding to the wall temperature in the process of LH2 regasification. The obtained results showed that the optimal length of TEG legs is less than 10 mm and depends on the boiling and heat transfer regime. The results of the presented research can be used to improve the effectivity of cold exergy recovery from cryogenic systems.