A theory of a D-type optical fiber sensor based on the Kretchmann's configuration and heterodyne interferometry is proposed. In the paper, we try to design a D-type optical fiber sensor, which is the Kretchmann's configuration of a three-layer scheme, and measure the phase difference variations instead of the light intensity. Therefore, its accuracy and resolution are very high. From numerical simulations, we can achieve the best sensitivity of the D-type optical fiber sensor by choosing suitable parameters, e.g., the thickness of the thin film layer of gold and the length of the sensor. The D-type fiber sensor has the tunable high sensitivity only if we choose different incident angle. Because the sensitivity of the sensor can reach a refractive index unit (RIU) of 2 × 10 -6 the D-type fiber sensor could be valuable for chemical, biological and biochemical sensing.