We use local and global magnetometry measurements to study the influence of magnetic domain width w on the domain-induced vortex pinning in superconducting/ferromagnetic bilayers, built of a Nb film and a ferromagnetic Co/Pt multilayer with perpendicular magnetic anisotropy, with an insulating layer to eliminate proximity effect. The quasi-periodic domain patterns with different and systematically adjustable width w, as acquired by a special demagnetization procedure, exert tunable vortex pinning on a superconducting layer. The largest enhancement of vortex pinning, by a factor of more than 10, occurs when w ≈ 0.31µm is close to the magnetic penetration depth.