Abstract The quantum anharmonic oscillator has been solved numerically using matrix diagonalization technique. The interaction potential consisting of quadratic ( 1 2 k x 2 ) and quartic ( λx 4 ) terms is embedded within an infinite square well potential of appropriate width, ‘ a ’ and its sine eigen functions are used as basis functions ‘ N ’ for the employed matrix method. The energy eigen values for the resultant Hamiltonian are solved in a free open source software (FOSS), Gnumeric, a simple worksheet environment. The numerical parameters ‘ a ’ and ‘ N ’ are optimized to converge to the expected energies for harmonic oscillator and those for anharmonic oscillator from perturbation theory for small values of physical parameter, ‘ λ ’. The pure quartic oscillator is studied for both small and large values of λ and validated with results obtained from other numerical techniques. The breakdown of perturbation approximation for large values of λ is also shown.