The structural, electronic and optical properties of Si nanocrystals of different size and shape, passivated with hydrogens, OH groups, or embedded in a SiO2 matrix are studied. The comparison between the embedded and free, suspended nanocrystals shows that the silica matrix produces a strain on the embedded NCs, that contributes to determine the band gap value. By including the strain on the hydroxided nanocrystals we are able to reproduce the electronic and optical properties of the full Si/SiO2 systems. Moreover we found that, while the quantum confinement dominates in the hydrogenated nanocrystals of all sizes, the behaviour of hydroxided and embedded nanocrystals strongly depends on the interface oxidation degree, in particular for diameters below 2 nm. Here, the proportion of NC atoms at the Si/SiO2 interface becomes relevant, producing surface-related states that may affect the quantum confinement appearing as inner band gap states and then drastically changing the optical response of the system.