An image forming apparatus includes: an upper part cover for covering the upper part of the body; a paper feeding portion disposed rearward of the upper part cover, into which paper is supplied; and a medium sensor disposed opposite the paper feeding portion, which judges the quality of paper; wherein a supporting portion molded integrally with the upper part cover for rotatably supporting the medium sensor is provided, and the medium sensor is provided with the first turning center supported on the supporting portion and the second turning center for rotatably holding the tip end portion at the free end side.