Shale gas extraction through hydraulic fracturing and horizontal drilling is increasing in China, particularly in Sichuan Basin. Production of unconventional shale gas with minimal environmental effects requires adequate management of wastewater from flowback and produced water (FP water) that is coextracted with natural gas. Here we present, for the first time, inorganic chemistry and multiple isotope (oxygen, hydrogen, boron, strontium, radium) data for FP water from 13 shale gas wells from the Lower Silurian Longmaxi Formation in the Weiyuan gas field, as well as produced waters from 35 conventional gas wells from underlying (Sinian, Cambrian) and overlying (Permian, Triassic) formations in Sichuan Basin. The chemical and isotope data indicate that the formation waters in Sichuan Basin originated from relics of different stages of evaporated seawater modified by water-rock interactions. The FP water from shale gas wells derives from blending of injected hydraulic fracturing water and entrapped saline (Cl ∼ 50,000 mg/L) formation water. Variations in the chemistry, δ18O, δ11B, and 87Sr/86Sr of FP water over time indicate that the mixing between the two sources varies with time, with a contribution of 75% (first 6 months) to 20% (>year) of the injected hydraulic fracturing water in the blend that compose the FP water. Mass-balance calculation suggests that the returned hydraulic fracturing water consisted of 28-49% of the volume of the injected hydraulic fracturing water, about a year after the initial hydraulic fracturing. We show differential mobilization of Na, B, Sr, and Li from the shale rocks during early stages of operation, which resulted in higher Na/Cl, B/Cl, Li/Cl, and 87Sr/86Sr and lower δ11B of the FP water during early stages of FP water formation relative to the original saline formation water recorded in late stages FP water. This study provides a geochemical framework for characterization of formation waters from different geological strata, and thus the ability to distinguish between different sources of oil and gas wastewater in Sichuan Basin.