As an important figure of merit for characterizing the quantized collective behaviors of the wavefunction, Chern number is the topological invariant of quantum Hall insulators. Chern number also identifies the topological properties of the photonic topological insulators (PTIs), thus it is of crucial importance in PTI design. The full-wave finite-difference frequency-domain (FDFD) method based MATLAB program for computing the Chern number has been written. Recently, the finite-difference method has been extended to analyze the topological invariant of non-Hermitian topological dielectric photonic crystals by first-principle Wilson loop calculation. All MATLAB codes can be found at GitHub website.