Disclosed herein is an ultraviolet sterilizer having a vibration-proof function. The ultraviolet sterilizer includes an ultraviolet sterilization unit. The ultraviolet sterilization unit has an inlet through which ballast water is drawn thereinto, an outlet through which the ballast water is discharged therefrom, and an ultraviolet lamp located between the inlet and the outlet. The ultraviolet lamp applies ultraviolet rays to the ballast water. The ultraviolet sterilizer further includes a cap which supports each of the opposite ends of the ultraviolet sterilization unit, and a shock absorption unit which is elastically compressed at a first end thereof by the cap while a second end thereof compresses an end of the ultraviolet lamp. Thereby, even if the ultraviolet sterilization unit vibrates, the sleeve pipe or the ultraviolet lamp can be prevented from being damaged, and explosive gas which may cause the ultraviolet sterilizer to explode is also prevented from entering the cap.