The star formation history in I Zw 18 has been inferred from Hubble Space Telescope Wide Field Planetary Camera 2 archival data. This is done by comparing the derived V, B-V and V, V-I color-magnitude diagrams and luminosity functions with synthetic ones, based on various sets of stellar evolutionary tracks. At a distance of 10 Mpc, the stars resolved in the field of I Zw 18 allow for a look-back time up to 1 Gyr. We find that the main body is not experiencing its first episode of star formation. Instead, it has been forming stars over the last 0.5-1 Gyr, at a rate of ~(1-2)x10–2M☉.yr–1.kpc–2. A more intense activity of (6-16)x10–2M☉.yr–1.kpc–2 has taken place between 15 and 20 Myr ago. For the secondary body, the look-back time is 0.2 Gyr at most and the uncertainty is much higher because of the shallower diagrams and the small number of resolved stars. The derived range of star formation rate is (3-10)x10–3M☉.yr–1.kpc–2. The IMF providing the best fit to the observed stellar populations in the main body has a slope 1.5, much flatter than in any similar galaxy analyzed with the same method. In the secondary body, it is peaked at α≃2.2, closer to Salpeter's slope (α=2.35).