Lightning localization is of great significance to weather forecasting, forest fire prevention, aviation, military, and other aspects. Traditional lightning localization requires the deployment of base stations and expensive measurement equipment. With the development of IoT technology and the continuous expansion of application scenarios, IoT devices can be interconnected through sensors and other technical means to ultimately achieve the goal of automatic intelligent computing. Therefore, this paper proposes a low-cost distributed thunder-localization system based on IoT smart devices, namely ThunderLoc. The main idea of ThunderLoc is to collect dual-microphone data from IoT smart devices, such as smartphones or smart speakers, through crowdsourcing, turning the localization problem into a search problem in Hamming space. We studied the dual microphones integrated with smartphones and used the sign of Time Difference Of Arrival (TDOA) as measurement information. Through a simple generalized cross-correlation method, the TDOA of thunderclaps on the same smartphone can be estimated. After quantifying the TDOA measurement from the smartphone node, thunder localization was performed by minimizing the Hamming distance between the binary sequence and the binary vector measured in a database. The ThunderLoc system was evaluated through extensive simulations and experiments (a testbed with 30 smartphone nodes). The extensive experimental results demonstrate that ThunderLoc outperforms the main existing schemes in terms of effectively locating position and good robustness.