Active electrolocation organ of weakly electric fish act as a proximity detection system with high accuracy in recognizing object parameters such as size and shape. In contrast, some fish with passive electrolocation organ are able to detect objects at a greater range. This paper proposes a joint active–passive electrolocation algorithm for long-range and high-precision underwater localization, inspired by the active and passive electroreceptive organs of fish. The study begins by designing a large experimental platform for the underwater localization system to investigate the response of underwater objects to active and passive electric fields. Based on the response, the paper proposes separate underwater active and passive electrolocation algorithms, which are then combined to form a joint algorithm. Experimental results demonstrate that the proposed algorithm achieves high localization accuracy and long detection distance. The joint active–passive electrolocation algorithm has potential applications in submarine resource exploration, underwater robotics, and maritime military projects, while also providing new ideas for future research on long-range underwater object detection and identification based on electrolocation.