An antifogging device includes: a heater configured to apply heat to an optical member a temperature sensor configured to detect a temperature a circuit board with a surface mounted the heater and the temperature sensor a sealing member that is made of a resin material and that is applied to the surface to seal the heater and the temperature sensor and a joining part that is provided on at least part of the surface and that is made of an inorganic material, the joining part being configured to: extend along a periphery of the surface in a state of being exposed to a side surface of the circuit board and contact the sealing member.