The objective of this thesis is to improve flow modeling through offshore natural gas pipelines. Gassco is a state owned Norwegian company responsible for the operation of 7800 km offshore natural gas pipelines located in the North Sea. The pipelines have a diameter of 1 m and can be up to 1000 km in length. Measurements of the state of the gas, such as pressure, mass flow, temperature and composition are available only at the inlet and outlet. To know the state of the gas between these two points one has to rely on computer models. Gassco uses commercial tools to model the flow of gas through their pipelines. These have previously given inaccurate results, especially during transient conditions. The flow of natural gas through long distance offshore pipelines is modeled by numerically solving the governing equations for one-dimensional compressible viscous heat conducting flow. An implicit finite difference scheme is used to solve the governing equations. Both spatial and temporal discretization errors are computed. The implemented flow model is validated by running simulations on one of Gassco’s offshore pipelines. Modeled results show good agreement with measured values, however some discrepancies are present, especially in the modeled outlet gas temperature. These discrepancies are determined to be caused by physical approximation errors, and not because of numerical errors or model simplifications. The sensitivity of the selection of the equation of state for high pressure natural gas pipelines is investigated by comparing the SRK, Peng-Robinson, BWRS, GERG 88 and GERG 2004 equations of state. Gassco currently uses a BWRS equation of state which is especially tuned for hydrocarbons. In a typical offshore natural gas pipeline, the difference in computed inlet pressure between using the tuned BWRS and the GERG 2004 equation of state was determined to be approximately 0.1 MPa (1 bar). Although GERG 2004 is believed to be the most accurate equation of state, it is computationally demanding compared to BWRS, resulting in BWRS being the preferred choice. Although there is a difference in computed inlet pressure between GERG 2004 and BWRS, this difference is relatively constant during both steady state and transient conditions. By tuning the equivalent sand grain roughness, the computed inlet pressure using both GERG 2004 and BWRS can be matched in order to compensate for differences in the equation of state. The heat exchange between the gas and the surrounding environment is modeled using two different approaches. The steady external heat transfer model currently used by Gassco is compared to an unsteady external heat transfer model which includes heat accumulation in the ground. It is shown by example that the steady heat transfer model over predicts the amplitude of temperature changes in the flow compared to the unsteady heat transfer model. The unsteady heat transfer model also improves the modeled inlet pressure and outlet mass flow during transient conditions. Although the modeled temperature is improved using the unsteady heat transfer model, there is still a discrepancy between modeled and measured outlet gas temperature. The most important parameters which can account for this deviation are the ambient sea bottom temperature, soil thermal conductivity and pipe burial length.