A method and device detect defects in the closure of encapsulated vials. The method includes scanning a profile of the capsule and of the vial using a profilometer, thus obtaining a point cloud. From the point cloud obtained, calculating at least one of the following parameters: diameter or radius of the closure circumference of the capsule; angle of intersection between the lower skirt and the side of the capsule; length of the lower skirt; and/or a distance from the end of the lower skirt to the neck of the vial. The method determines whether any of the parameters calculated in the previous step exceeds a predetermined value. The device detecting defects in the closure of encapsulated vials includes a profilometer configured to scan a profile of the capsule and of the vial and a control device configured to execute the method.