Purpose: To study the response of a silicon diode in clinical electron beams by using the EGSnrc Monte Carlo code. Method and Materials: A Monte Carlo model of a cylindrical diode (from Rikner and Grusell) has been constructed. The diode is put on the central axis of a cylindrical water phantom and the dose ratios of water/silicon at various depths in 6 MeV electron beams are calculated. The dose ratio is also calculated for a bare silicon pellet of the same size as the active volume of the diode. Both calculated dose ratios are compared with the calculated water/silicon restricted stopping‐power ratio (SPR) as a function of depth. The dose ratio is calculated as well for various field sizes at the reference depth in the 6 MeV electron beam. Results: For the diode model, the dose ratio versus depth in electron beams is nearly flat: within 1% from near the phantom surface to R50 (calculation uncertainty <0.5%). For the pellet, the dose ratio versus depth behaves almost the same as the Spencer‐Attix water/silicon SPR with Δ = 100 keV. It varies more than 3% with depth. The diode dose ratio changes by less than 0.5% for field sizes ranging from 2 to 10 cm (beam radius) although it is 1.6% smaller in a 1 cm radius beam. Conclusion: The silicon pellet behaves like an ideal Spencer‐Attix cavity with Δ slightly greater than 100 keV. The Si behind the active region plays an important role in making the overall dosimeter response flat within about 1% per unit dose to water. The silicon diode is an excellent dosimeter for electron beams since its response relative to the dose to water changes little with respect to the depth in phantom or the field size of source.