We perform molecular dynamics simulation study of CO2, methane, and their mixture in the presence of brine over a broad range of temperature (311–473 K), pressure (up to about 100 MPa), and NaCl concentration (up to about 14 wt %). The general decrease in the interfacial tension (IFT) values of the CH4–brine system with pressure and temperature is similar to that obtained for the corresponding CH4–water system. The IFT of methane and brine is a linearly increasing function of salt concentration, and the resulting slopes are dependent on the pressure. A similar behavior as methane is observed for such systems containing CO2 and CO2–CH4 mixture. The IFT of CO2 and brine increases linearly with increasing salt content; however, the resulting slopes are independent of pressure. The simulations show that the presence of CO2 decreases the IFT values of the CH4–water and CH4–brine systems, but the degree of reduction depends on the amount of CO2 in each sample, which is consistent with experimental evidence. These IFT values show a linear correlation with the amount of CO2, and the resulting slopes are dependent on the temperature and pressure. Furthermore, our results for the mole fractions of the different species in the CO2–CH4–water system at 323 K and 9 MPa are in agreement with those of experiments. The mole fractions of methane and CO2 in the water-rich phase decrease with increasing salt concentration, whereas that of H2O in the methane- or CO2-rich phases remains almost unaffected in all of the studied cases. Our results could be useful because of the importance of carbon dioxide sequestration and shale gas production.