Two new compounds K3TaP2O9 and Na3TaP2O9 were obtained by spontaneous crystallization with KH2PO4 and K2HPO4 or NaH2PO4 and Na2HPO4 as fluxes, respectively. K3TaP2O9 belongs to the P21/m space group of the monoclinic system, with cell parameters of a = 9.8912(7) Å, b = 7.1861(5) Å, c = 13.6457(9) Å, β = 94.047(2)°, and Z = 4. In contrast, Na3TaP2O9 pertains to the P212121 space group of the orthorhombic system, with cell parameters of a = 7.1241(7) Å, b = 9.3071(10) Å, c = 12.3752(13) Å, and Z = 4. Both of the structures feature the existence of the zigzag (TaP2O9)∞ chains with the -(O4Ta)-O-(TaO4)- connection. Also, two compounds have high transparency of about 90% in the 400-2500 nm range. Theoretical calculations and powder second-harmonic generation test show that the compound Na3TaP2O9 has a large band gap of 5.5 eV, a moderate powder second-harmonic generation response of 0.6 × KDP, and a large birefringence of 0.11.