An optical module is provided, including a movable portion, a fixed portion and a driving assembly. The movable portion is used to hold an optical element having an optical axis. The movable portion is movably connected to the fixed portion. The driving assembly disposed in the fixed portion to drive the movable portion to move along the optical axis relative to the fixed portion. The driving assembly includes a first magnetic element and a second magnetic element. The first magnetic element and the second magnetic element are aligned along the optical axis. The size of the first magnetic element and the size of the second magnetic element along the optical axis are different.