To solve the problem of attitude determination using magnetometers independently and uniquely, which is important for underwater vehicles, a type of full attitude determination method based on geomagnetic gradient tensor is proposed in this paper. In this method, a group of non-linear equations concerning geomagnetic gradient tensors is established, where a quaternion is selected to calculate three attitude angles of an underwater vehicle. The optimal quaternion is estimated using Newton Down-hill to optimise the object function. The detailed steps of the full attitude determination based on geomagnetic gradient tensor are given, and the effects of the initial angle error and the sensor noise on the attitude determination are investigated. Simulations show that the algorithm can identify precisely and quickly the attitudes even in the presence of larger initial angle error and sensor noise, which proves the attitude determination algorithm.