Modern healthcare is transforming from hospital-centric to individual-centric systems. Emerging implantable and wearable medical (IWM) devices are integral parts of enabling affordable and accessible healthcare. Early disease diagnosis and preventive measures are possible by continuously monitoring clinically significant physiological parameters. However, most IWM devices are battery-operated, requiring replacement, which interrupts the proper functioning of these devices. For the continuous operation of medical devices for an extended period of time, supplying uninterrupted energy is crucial. A sustainable and health-compatible energy supply will ensure the high-performance real-time functioning of IWM devices and prolong their lifetime. Therefore, harvesting energy from the human body and ambient environment is necessary for enduring precision healthcare and maximizing user comfort. Energy harvesters convert energy from various sources into an equivalent electrical form. This paper presents a state-of-the-art comprehensive review of energy harvesting techniques focusing on medical applications. Various energy harvesting approaches, working principles, and the current state are discussed. In addition, the advantages and limitations of different methods are analyzed and existing challenges and prospects for improvement are outlined. This paper will help with understanding the energy harvesting technologies for the development of high-efficiency, reliable, robust, and battery-free portable medical devices. [ABSTRACT FROM AUTHOR]