A method of obtaining a location of a user, the method comprising: obtaining first location information of the user; searching a pre-stored first map including magnetic field information for a plurality of candidate areas corresponding to the first location information; obtaining second location information of the user; searching a pre-stored second map including the magnetic field information for a plurality of candidate areas corresponding to the second location information; determining whether the plurality of candidate areas corresponding to the first location information overlap the plurality of candidate areas corresponding to the second location information; selecting at least one search area from the plurality of candidate areas corresponding to the first location information based on the second location information of the user or from the plurality of candidate areas corresponding to the first location information that overlaps the plurality of candidate areas corresponding to the second location information; and determining the at least one search area as the location of the user within the at least one search area, wherein the first location information includes one of a horizontal magnetic field component value, a vertical magnetic field component value, a direction of a magnetic field, and an angle between horizontality and verticality that are measured by a magnetic field sensor, wherein the second location information includes one of the horizontal magnetic field component value, the vertical magnetic field component value, the direction of the magnetic field, and the angle between horizontality and verticality that are measured by the magnetic field sensor except for the one included in the first location information, wherein the pre-stored first map and the pre-stored second map include coordinate information of a magnetic field map, and wherein the magnetic field information at the coordinates is saved as three-dimensional components. obtaining first location information of the user; searching a pre-stored first map including magnetic field information for a plurality of candidate areas corresponding to the first location information; obtaining second location information of the user; searching a pre-stored second map including the magnetic field information for a plurality of candidate areas corresponding to the second location information; determining whether the plurality of candidate areas corresponding to the first location information overlap the plurality of candidate areas corresponding to the second location information; selecting at least one search area from the plurality of candidate areas corresponding to the first location information based on the second location information of the user or from the plurality of candidate areas corresponding to the first location information that overlaps the plurality of candidate areas corresponding to the second location information; and determining the at least one search area as the location of the user within the at least one search area, wherein the first location information includes one of a horizontal magnetic field component value, a vertical magnetic field component value, a direction of a magnetic field, and an angle between horizontality and verticality that are measured by a magnetic field sensor, wherein the second location information includes one of the horizontal magnetic field component value, the vertical magnetic field component value, the direction of the magnetic field, and the angle between horizontality and verticality that are measured by the magnetic field sensor except for the one included in the first location information, wherein the pre-stored first map and the pre-stored second map include coordinate information of a magnetic field map, and wherein the magnetic field information at the coordinates is saved as three-dimensional components.