An imaging lens includes first, second, third, fourth, fifth, sixth and seventh lens elements arranged in a sequence from an object side to an image side along an optical axis. Each lens element has an object-side surface and an image-side surface. The object-side of the third lens element has a convex portion in a vicinity of a periphery. The object-side of the fifth lens element has a convex portion in a vicinity of the optical axis and a concave portion in a vicinity of a periphery. The object-side of the sixth lens element has a concave portion in a vicinity of a periphery. All of lens elements having refracting power of the imaging lens are the first, second, third, fourth, fifth, sixth and seventh lens elements.’