This paper presents an error-state extended Kalman filter with data fusion for orientation estimation. The rotation parameterization is described by quaternion representation. A MARG (magnetic, angular rate, gravity) sensor is used for measurement system. The nonlinear process model consists of 6 error-states and is independent of the rigid body dynamics. The nonlinear measurement model is obtained from the basic principles of accelerometer and magnetometer. The advantages of this approach are: independency of estimation process from the dynamic model of rigid body and avoiding the singularity in estimated error covariance matrix. Simulation results are presented to show the advantages of this approach and using the EKF.