A batch filter has been designed to autonomously estimate the orbit of a spacecraft using only sensor data from an onboard magnetometer and sun sensor. The goal has been to prove the feasibility of a proposed low-cost, moderate-accuracy autonomous orbit determination system. The system uses a batch filter to estimate the Keplerian orbital parameters, a drag parameter, magnetometer biases, and corrections to the Earth's magnetic field. It does this by minimizing the square errors between measured and estimated values of two quantities, the Earth's magnetic field magnitude and the cosine of the angle between the sun vector and the Earth's magnetic field vector, both measured at the spacecraft. The proposed system is observable, and reasonable accuracy is obtainable, Given a magnetometer with a 10-nT 1-sigma accuracy and a sun sensor with a 0.005-deg 1-sigma accuracy, the system can achieve 1-sigma position accuracies on the order of 500 m for inclined low Earth orbits.