A card reader, comprising: a magnetic head which is configured to perform at least one of reading of magnetic data recorded in a card and recording of magnetic data to the card; a card insertion member which is formed with a card insertion port into which the card is inserted; and a light emitting element and a light receiving element structured to detect that a foreign matter has been attached to the card insertion member; wherein when a side in an inserting direction of the card to the card insertion port is defined as a rear side, a side in an ejecting direction of the card from the card insertion port is defined as a front side, one side in a thickness direction of the card inserted into the card insertion port is defined as a first direction side, an opposite side to the first direction side is defined as a second direction side, and an inserting and ejecting direction of the card into and from the card insertion port is defined as a front and rear direction, the magnetic head is disposed so as to contact with the card from the first direction side; a face on the first direction side of the card insertion port is formed to be an inclined face in a protruding curved face shape or in a flat face shape which is inclined toward the first direction side as going to the front side; light emitted from the light emitting element is passed through a part of the card insertion member, characterized in that the light is then incident on the inclined face from the rear side and the first direction side and is refracted at the inclined face and is emitted from the inclined face toward at least the front side; and light emitted from the light emitting element and reflected on the front side and the second direction side of the inclined face, and light emitted from the light emitting element and reflected on the front side of the card insertion member are incident on the light receiving element. a magnetic head which is configured to perform at least one of reading of magnetic data recorded in a card and recording of magnetic data to the card; a card insertion member which is formed with a card insertion port into which the card is inserted; and a light emitting element and a light receiving element structured to detect that a foreign matter has been attached to the card insertion member; wherein when a side in an inserting direction of the card to the card insertion port is defined as a rear side, a side in an ejecting direction of the card from the card insertion port is defined as a front side, one side in a thickness direction of the card inserted into the card insertion port is defined as a first direction side, an opposite side to the first direction side is defined as a second direction side, and an inserting and ejecting direction of the card into and from the card insertion port is defined as a front and rear direction, the magnetic head is disposed so as to contact with the card from the first direction side; a face on the first direction side of the card insertion port is formed to be an inclined face in a protruding curved face shape or in a flat face shape which is inclined toward the first direction side as going to the front side; light emitted from the light emitting element is passed through a part of the card insertion member, characterized in that the light is then incident on the inclined face from the rear side and the first direction side and is refracted at the inclined face and is emitted from the inclined face toward at least the front side; and light emitted from the light emitting element and reflected on the front side and the second direction side of the inclined face, and light emitted from the light emitting element and reflected on the front side of the card insertion member are incident on the light receiving element.