In this paper, we investigate the simulation of violation of the Wright inequality by the classical optical experiment theoretically and experimentally. The feasibility of the simulation is demonstrated by theoretical analysis based on descriptions of the classical electrodynamics and quantum mechanics, respectively. Then, the simulation of violation of the Wright inequality is realized experimentally. The setup is based on a laser source, free-space optical devices and power meters. The experimental result violates the noncontextuality hidden variable bound, agreeing with the quantum bound. This method can be extended to other types of noncontextuality inequalities.