Stylolites are features of localized dissolution in sedimentary rocks. They are planes oriented normal to the compaction direction and have a rough and often teeth-like surface structure. The vertical spacing of individual stylolite planes are often constant within one rock sample or outcrop. There is no general agreement on how these rough planes of localized compaction form. We present experimental result in this thesis that suggests that the characteristic diffusion length of solute is important for both the localization process and the vertical spacing of individual stylolite planes. We have done experiments where granular systems are compacting by pressure solution and by mechanicalcompaction. The results from the mechanically compacted experiment shows a clear anticrack formation around an inclusion in the compacting matrix. The results from the experiments compacted by pressure solution on the other hand show no localized compaction around the inclusion at all. There is no anticrack. The system develops spontaneously a "compaction band" structure oriented normal to the compaction direction. The spacing between the bands in this band structure is 1-2 mm, which is consistent with stylolite spacing in calcitic rock of 20-150 cm, assuming that the precipitationrate determines the characteristic diffusion length. We know that individual stylolite planes will approach each other with up to 10 cm because of dissolution of rock on the stylolite surface. Our estimate of stylolite spacing fits observed spacings surprisingly well. The localization in our experiments is clearly not triggered by the inclusion. We propose that the mechanism for localization is initial porosity variations and/or variations in clay concentrationscombined with a long characteristic diffusion length, which alsocontrols the spacing of individual stylolite planes. We also do roughening experiments where polished sintered salt blocks stacked on top of each other in a cylinder, and stressed in the direction normal to the surface. The results from these experiments propose a roughening with a wavelength of 2-4 mm.