A displacement sensor (10, 10A, 10B) which is adapted to detect displacement of a measurement object, comprising: a linear light source (1, 2, 3, 4, 100) which emits a linear beam; a beam splitter; a line sensor; and an imaging lens, wherein the linear light source (1, 2, 3, 4, 100) is disposed with an inclination of a predetermined angle with respect to a perpendicular line of an optical axis of the imaging lens, wherein the imaging lens forms an image of the linear light source (1, 2, 3, 4, 100) at a position conjugate with the linear light source (1, 2, 3, 4, 100) with an inclination of a predetermined angle with respect to the perpendicular line of the optical axis of the imaging lens, wherein the beam splitter is disposed between the linear light source (1, 2, 3, 4, 100) and the imaging lens, wherein the line sensor is disposed at a position conjugate with the image formed by the imaging lens through the imaging lens and the beam splitter so that the optical axis of the imaging lens has the inclination of the predetermined angle with respect to the perpendicular line of the optical axis reflected by the beam splitter, and wherein the displacement sensor (10, 10A, 10B) further comprises: an inclination sensor configured to detect an inclination between the measurement object and the optical axis of the imaging lens corresponding to the optical axis of the displacement sensor (10, 10A, 10B); and a detection circuit configured to correct a displacement measured by the displacement sensor (10, 10A, 10B) based on the inclination detected by the inclination sensor. a linear light source (1, 2, 3, 4, 100) which emits a linear beam; a beam splitter; a line sensor; and an imaging lens, wherein the linear light source (1, 2, 3, 4, 100) is disposed with an inclination of a predetermined angle with respect to a perpendicular line of an optical axis of the imaging lens, wherein the imaging lens forms an image of the linear light source (1, 2, 3, 4, 100) at a position conjugate with the linear light source (1, 2, 3, 4, 100) with an inclination of a predetermined angle with respect to the perpendicular line of the optical axis of the imaging lens, wherein the beam splitter is disposed between the linear light source (1, 2, 3, 4, 100) and the imaging lens, wherein the line sensor is disposed at a position conjugate with the image formed by the imaging lens through the imaging lens and the beam splitter so that the optical axis of the imaging lens has the inclination of the predetermined angle with respect to the perpendicular line of the optical axis reflected by the beam splitter, and wherein the displacement sensor (10, 10A, 10B) further comprises: an inclination sensor configured to detect an inclination between the measurement object and the optical axis of the imaging lens corresponding to the optical axis of the displacement sensor (10, 10A, 10B); and a detection circuit configured to correct a displacement measured by the displacement sensor (10, 10A, 10B) based on the inclination detected by the inclination sensor. an inclination sensor configured to detect an inclination between the measurement object and the optical axis of the imaging lens corresponding to the optical axis of the displacement sensor (10, 10A, 10B); and a detection circuit configured to correct a displacement measured by the displacement sensor (10, 10A, 10B) based on the inclination detected by the inclination sensor.