An ultrasonic nebulizer includes a tank unit configured to be detachable with respect to a main body. The tank unit includes a working tank in which an ultrasonic vibrator is incorporated, a medicine tank, and a medicine tank cover, which are arranged overlaid in the stated order. The output of an oscillation circuit in the main body is applied to the ultrasonic vibrator through a main body-side contact electrode and a tank-side contact electrode when the tank unit is mounted on the main body. The main body includes an air fan that blows air into the medicine tank through an air duct of the medicine tank cover, and a medicine tank cover detection unit that detects whether or not the air duct of the medicine tank cover is adjacent to the main body so as to detect whether or not the tank unit is mounted on the main body.