Context : Aims : Our goal is to find how the spatial correlation function of galaxies describes the multifractal nature of the cosmic web . Methods : We calculate spatial correlation functions of galaxies , \xi ( r ) , structure functions , g ( r ) = 1 + \xi ( r ) , and fractal dimension functions , D ( x ) = 3 + \gamma ( r ) = 3 + d \log g ( r ) / d \log r , using dark matter particles of biased \Lambda cold dark matter ( CDM ) simulation , observed galaxies of the Sloan Digital Sky Survey ( SDSS ) , and simulated galaxies of the Millennium and EAGLE simulations . We analyse how these functions describe fractal and other geometrical properties of the cosmic web . Results : Correlation functions of biased \Lambda CDM model samples describe at small distances ( particle/galaxy separations ) , r \leq 2.25 h ^ { -1 } Mpc , the distribution of matter inside DM halos . In real and simulated galaxy samples only brightest galaxies in clusters are visible , and the transition from clusters to filaments occurs at distance r \approx 0.8 - 1.5 h ^ { -1 } Mpc . On larger separations correlation functions describe the distribution of matter and galaxies in the whole cosmic web . The effective fractal dimension of the cosmic web is a continuous function of the distance ( separation ) . On small separations , r \leq 2 h ^ { -1 } Mpc , the fractal dimension decreases from D \approx 1.5 to D \approx 0 , reflecting the distribution inside halos/clusters . The minimum of the fractal dimension function D ( r ) near r \approx 2 is deeper for more luminous galaxies . On medium separations , 2 \leq r \leq 10 h ^ { -1 } Mpc , the fractal dimension grows from \approx 0 to \approx 2 , and approaches at large separations 3 ( random distribution ) . Real and simulated galaxies of low luminosity , M _ { r } \geq - 19 , have almost identical correlation lengths and amplitudes , indicating that dwarf galaxies are satellites of brighter galaxies , and do not form a smooth population in voids . Conclusions : Spatial correlation functions of galaxies contain valuable information on fractal dimension and other geometrical properties of the cosmic web .