A three-axis digital compass, comprising: a flux concentrator; two X-axis magnetic sensors (1, 2) adapted to detect the X-axis component of an external magnetic field respectively located around the edges of the flux concentrator on both sides along the X-axis direction; two Y-axis magnetic sensors (3, 4) adapted to detect the Y-axis component of an external magnetic field respectively located around the edges of the flux concentrator on both sides along the Y-axis direction; wherein each of the X-axis magnetic sensors and the Y-axis magnetic sensors are deposited on the surface of a substrate and are adapted to sense a magnetic field component parallel to the substrate surface, the surface of the substrate being parallel to the XY plane and perpendicular to the Z-axis; wherein the flux concentrator is adapted to distort an external magnetic field such that the Z-axis component of the external magnetic field is respectively turned into X-axis and Y-axis magnetic field components where the two X-axis magnetic sensors and two Y-axis magnetic sensors are located; and a signal sampling unit, which is connected to an output terminal of each of the magnetic sensors, for use in sampling output signals from the magnetic sensors; characterised in that the three-axis compass further comprises: a signal processing unit, which is connected to an output of the sampling unit, and the signal processing unit is adapted to calculate the corresponding X-axis, Y-axis, and Z-axis magnetic field components from the sampled output signals of the two X-axis magnetic sensors and two Y-axis magnetic sensors; and a signal output unit, adapted to send out a digital signal representing the calculation performed by the signal processing unit. a flux concentrator; two X-axis magnetic sensors (1, 2) adapted to detect the X-axis component of an external magnetic field respectively located around the edges of the flux concentrator on both sides along the X-axis direction; two Y-axis magnetic sensors (3, 4) adapted to detect the Y-axis component of an external magnetic field respectively located around the edges of the flux concentrator on both sides along the Y-axis direction; wherein each of the X-axis magnetic sensors and the Y-axis magnetic sensors are deposited on the surface of a substrate and are adapted to sense a magnetic field component parallel to the substrate surface, the surface of the substrate being parallel to the XY plane and perpendicular to the Z-axis; wherein the flux concentrator is adapted to distort an external magnetic field such that the Z-axis component of the external magnetic field is respectively turned into X-axis and Y-axis magnetic field components where the two X-axis magnetic sensors and two Y-axis magnetic sensors are located; and a signal sampling unit, which is connected to an output terminal of each of the magnetic sensors, for use in sampling output signals from the magnetic sensors; characterised in that the three-axis compass further comprises: a signal processing unit, which is connected to an output of the sampling unit, and the signal processing unit is adapted to calculate the corresponding X-axis, Y-axis, and Z-axis magnetic field components from the sampled output signals of the two X-axis magnetic sensors and two Y-axis magnetic sensors; and a signal output unit, adapted to send out a digital signal representing the calculation performed by the signal processing unit. a signal processing unit, which is connected to an output of the sampling unit, and the signal processing unit is adapted to calculate the corresponding X-axis, Y-axis, and Z-axis magnetic field components from the sampled output signals of the two X-axis magnetic sensors and two Y-axis magnetic sensors; and a signal output unit, adapted to send out a digital signal representing the calculation performed by the signal processing unit.