Interior models of Jupiter and Saturn are calculated and compared in the framework of the three-layer assumption, which rely on the perception that both planets consist of three globally homogeneous regions: a dense core, a metallic hydrogen envelope, and a molecular hydrogen envelope. Within this framework, constraints on the core mass and abundance of heavy elements (i.e. elements other than hydrogen and helium) are given by accounting for uncertainties on the measured gravitational moments, surface temperature, surface helium abundance, and on the inferred protosolar helium abundance, equations of state, temperature profile and solid/differential interior rotation. Results obtained solely from static models matching the measured gravitational fields indicate that the mass of Jupiter's dense core is less than 14 M⊕ (Earth masses), but that models with no core are possible given the current uncertainties on the hydrogen-helium equation of state. Similarly, Saturn's core mass is less than 22 M⊕ but no lower limit can be inferred. The total mass of heavy elements (including that in the core) is constrained to lie between 11 and 42 M⊕ in Jupiter, and between 19 and 31 M⊕ in Saturn. The enrichment in heavy elements of their molecular envelopes is 1-6.5, and 0.5-12 times the solar value, respectively. Additional constraints from evolution models accounting for the progressive differentiation of helium (Hubbard WB, Guillot T, Marley MS, Burrows A, Lunine JI, Saumon D, 1999. Comparative evolution of Jupiter and Saturn. Planet. Space Sci. 47, 1175-1182) are used to obtain tighter, albeit less robust, constraints. The resulting core masses are then expected to be in the range 0-10 M⊕, and 6-17 M⊕ for Jupiter and Saturn, respectively. Furthermore, it is shown that Saturn's atmospheric helium mass mixing ratio, as derived from Voyager, Y=0.06±0.05, is probably too low. Static and evolution models favor a value of Y=0.11-0.25. Using, Y=0.16±0.05, Saturn's molecular region is found to be enriched in heavy elements by 3.5 to 10 times the solar value, in relatively good agreement with the measured methane abundance. Finally, in all cases, the gravitational moment J6 of models matching all the constraints are found to lie between 0.35 and 0.38×10 -4 for Jupiter, and between 0.90 and 0.98×10 -4 for Saturn, assuming solid rotation. For comparison, the uncertainties on the measured J6 are about 10 times larger. More accurate measurements of J6 (as expected from the Cassini orbiter for Saturn) will therefore permit to test the validity of interior models calculations and the magnitude of differential rotation in the planetary interior.