Dosimetric characteristics of the flattening filter (FF) and flattening filter free (FFF) modes of 18 MV therapeutic photon beam were investigated with and without the magnetic deflector (MD) and lead filter. MCNP version 6.1.0 Monte Carlo (MC) code was used to simulate the 18 MV photon beam of 2100 C/D-Varian linear accelerator (LINAC) for the FF and FFF modes. The MD (uniform magnetic flux density of 1 Tesla) and lead filter (thickness of 1 mm) were modeled to remove contaminant electrons. The dosimetric parameters for different scenarios of LINAC’s head were calculated. Removing the flattening filter in the FFF mode increased the dose rate, electron contamination, skin dose, out-of-field dose and un-flatness compared to the FF mode. While the lead filter decreased the contaminant electrons significantly, using the MD removed all secondary electrons from the beam line. The surface dose was decreased by 8.3 % and 11.2 % for the magnetic deflector (MD) and lead filter in the FF mode, respectively. The surface dose was decreased by 16.8 % and 20.3 % for the MD and lead filter scenarios in the FFF mode, respectively. The MD and lead filter decreased surface penumbra by 15.5 % and 11.5 % compared to the FFF mode. Removing the flattening filter from the LINAC’s head improves most of the dosimetric characteristics of the 18MV therapeutic beam. The use of a lead filter and magnetic deflector preserves the skin-sparing property of megavoltage beams that deteriorate in FFF mode. However, using a magnetic deflector does not reduce photon fluence and dose rate.