The effects of different solvents on the structure of microcrystalline and nanofibrillated cellulose (MCC, NFC) were studied using small-angle x-ray scattering (SAXS). MCC was immersed in water, ethanol, and acetone, and NFC was immersed only in water and ethanol, but studied also in the form of foam-like water-NFC-gel in wet, air-dried and re-wet states. The solvent affected the average chord length, which reveals the typical length scale of the structure of the sample: 2.4 +/- 0.1 nm was obtained for MCC-water, 2.5 +/- 0.1 nm for re-wet NFC-gel, 1.6 +/- 0.1 nm for MCC-ethanol, 1.2 +/- 0.1 nm for NFC-ethanol, and 1.3 +/- 0.1 nm for MCC-acetone. The specific surface of cellulose increased strongly when MCC and NFC were immersed in the solvents compared to dry cellulose. The specific surface of cellulose was determined to be larger for NFC-water than MCC-water, and slightly larger for dry NFC powder than for dry MCC, which can be explained by the fact that the width of cellulose crystallites perpendicular to the cellulose chain direction was slightly larger in MCC than in NFC on the basis of wide-angle x-ray scattering results.