A hospital bed with bed leaving alarm function includes a bed frame unit, a plurality of support pads mounted on the bed frame unit to together form a bed surface, on which a patient lies, sits or leans and a plurality of casters. At least one bed leaving sensing unit is provided on a middle section of the bed surface and connected to an external monitoring device. Each bed leaving sensing unit includes a substrate for correspondingly locking to a top of the support pads, and a plurality of sensors spaced on the substrate and electrically connected to the monitoring device. The bed leaving sensing unit provides pressure data to the monitoring device, and the monitoring device emits an alarm when the pressure data indicates the patient is not lying on the bed, so as to prevent the patient from leaving bed alone or carelessly falling off the hospital bed.