A computational research study of the structural, electronic, and optical characteristics of double half-Heusler alloys Ta2FeNiSn2 and Nb2FeNiSn2 is presented by performing ab initio calculations. The density functional theory framework employs the full-potential linearized augmented plane wave (FP-LAPW) method to solve Kohn-Sham equation as implemented in the Wien2k code. The exchange-correlation potential is processed by using the LDA and the GGA-PBE approximations to calculate the total energy and other physical properties. The obtained results showed that both alloys possess high cohesive energies, where Nb2FeNiSn2 (7.213 eV/atom) is more consistent than Ta2FeNiSn2 (6.249 eV/atom), these remarkable results support the structural stability for both alloys. Also, the thermodynamic stability of both compounds was confirmed through calculating the formation energy as the obtained results were close to the results obtained in as well as given the Open Quantum Materials Database (OQMD).Electronic characteristics and chemical bonding are illustrated and discussed by computing the electron charge density, DOS, and bandstructure. Both alloys show semiconductor behavior with (~ 0.5 eV) indirect energy bandgap. Also, we have calculated and analyzed the complex dielectric function, absorption coefficient, as well as, reflectivity spectra for both compounds. The semi local Boltzmann transport theory has been employed to treat temperature effect on thermoelectric properties of Ta2FeNiSn2 and Nb2FeNiSn2 compounds where the obtained results appears that both compounds have high coefficient at the normal condition, and they also have a good power factor at the Fermi level, which emphasizes that the thermoelectric efficiency of the two compounds is good and does not require doping. Also, depending on the quasi-harmonic model was used for estimating the heat capacity, the lattice thermal conductivity, the thermal expansion, and the Debye temperature under the pressure effects.