Recent outbreaks of deadly infectious diseases, such as Ebola and Middle East respiratory syndrome coronavirus, have motivated the research for accurate, rapid diagnostics that can be administered at the point of care. Nucleic acid biomarkers for these diseases can be amplified and quantified via polymerase chain reaction (PCR). In order to solve the problems of conventional PCR--speed, uniform heating and cooling, and massive metal heating blocks--an innovative optofluidic cavity PCR method using light-emitting diodes (LEDs) is accomplished. Using this device, 30 thermal cycles between 94 °C and 68 °C can be accomplished in 4 min for 1.3 μL (10 min for 10 μL). Simulation results show that temperature differences across the 750 μm thick cavity are less than 2 °C and 0.2 °C, respectively, at 94 °C and 68 °C. Nucleic acid concentrations as low as 10(-8) ng μL(-1) (2 DNA copies per μL) can be amplified with 40 PCR thermal cycles. This simple, ultrafast, precise, robust, and low-cost optofluidic cavity PCR is favorable for advanced molecular diagnostics and precision medicine. It is especially important for the development of lightweight, point-of-care devices for use in both developing and developed countries.