The physical state and properties of silicates at conditions encountered in the cores of gas giants, ice giants, and of Earth-like exoplanets now discovered with masses up to several times the mass of the Earth remain mostly unknown. Here, we report on theoretical predictions of the properties of silica, SiO2, up to 4 TPa and about 20 000 K by using first principles molecular dynamics simulations based on density functional theory. For conditions found in the super Earths and in ice giants, we show that silica remains a poor electrical conductor up to 10 Mbar due to an increase in the Si-O coordination with pressure. For Jupiter and Saturn cores, we find that MgSiO3 silicate has not only dissociated into MgO and SiO2, as shown in previous studies, but that these two phases have likely differentiated to lead to a core made of liquid SiO2 and solid (Mg,Fe)O.