With stricter emission legislations and demands on low fuel consumption, new engine technologies are continuously investigated. At the same time the accuracy in the over all engine control and diagnosis and hence also the required estimation accuracy is tightened. Central for the internal combustion control is the trapped cylinder charge and composition Traditionally cylinder charge is estimated using mean intake manifold pressure and engine speed in a two dimensional lookup table. With the introduction of variable valve timing, two additional degrees of freedom are introduced that makes this approach very time consuming and therefore expensive. Especially if the cam phasers are given large enough authority to offer powerful thermal management possibilities. The paper presents a physical model for estimating in-cylinder trapped mass and residual gas fraction utilizing cylinder pressure measurements, and intake and exhaust valve lift profiles. The cylinder pressure at intake and exhaust valve opening and closing together with manifold pressures and temperatures are combined with thermodynamic and heat transfer models to calculate the trapped cylinder mass. The estimator is validated on test data from a prototype engine with dual independent cam phasers under a wide range of operating conditions, including large variations in valve timing ranging from scavenging to early exhaust cam timing for thermal management. The main contribution is the developed model, with the ability to accurately estimate the trapped cylinder charge during large independent variations in both intake and exhaust valve timing.