In this research, linear and nonlinear optical properties of NiO nanoparticles (NPs) dissolved in ethanol were investigated. Linear optical characteristics of NiO NPs were studied using a UV-Vis spectrophotometer. The linear absorption coefficient (α0) was 0.88 and 0.57 cm-1 at 405 and 532 nm wavelengths, respectively. The band gap energy rose from 3.56 eV for a sample with a 10-7 g/ml concentration to 3.92 eV for the 10-3 g/ml concentration sample. Using the Z-scan technique, the nonlinear optical characteristics of the NPs were investigated. Two continuous wave laser diodes with 405 and 532 nm wavelengths and different powers were used. The Z-scan system with a closed aperture revealed that NiO NPs have a negative n2 (self-defocusing effect) at various laser powers. n2 increases as the power of the laser increases. The value of n2 was found to be 0.51×10-4 cm2/mW at a wavelength of 405 nm and a power of 0.33 mW. It improved as the laser power increased, reaching a maximum of 0.64×10-4 cm2/mW at a laser power of 1.51 mW. For the laser with a wavelength of 532 nm, the n2 value was 0.27×10-4 cm2/mW for a laser power of 1.01 mW. This value increased to 0.76×10-4 cm2/mW when the laser power increased to 6.2 mW. As measured by the Z-scan system with an open aperture, NiO NPs have a nonlinear absorption coefficient and display a two-photon absorption behavior.