A New real-time position and orientation tracking system for endoscopy is described. Three coils sequentiallyfed with current comprise the excitation source which will produce magnetic field. According to Biot-Savart-Laplace law, flux intensity data detected by three-axis magnetic sensor could be interpreted into information that will reflect the sensor's specific position, thus realizing the position determination. Also, data detected by the magnetic sensor and gravity sensor changes in connection with the spatial angles. By researching the change law between the two, spatial angles of the sensor is calculated, thus realizing orientation determination. It is shown errors in position determination is,errors in orientation determination is , the tracking frequency of the system is 10 Hz.