An ultrasonic device includes a substrate that is provided with an opening and a partition wall surrounding the opening, a vibration portion that closes one end side of the opening, and a piezoelectric element that is provided in the vibration portion, in which, in a case where an opening width dimension of the opening is indicated by W, and a thickness dimension of the substrate is indicated by H, a ratio W/H is 0.66 to 0.92.