In this paper, the effect of a magnetic field on natural convection flow in a nanofluid-filled inclined square cavity has been analyzed by Lattice Boltzmann method (LBM). The cavity is filled with water and nanoparticles of copper at the presence of a magnetic field. This study has been carried out for the pertinent parameters in the following ranges: the Rayleigh number of the base fluid, Ra=103-105, the volumetric fractions of nanoparticles between 0 and 6% and inclined angle (θ) of the cavity between θ= -60 degree and 60 degree with interval of 30 degree.The Hartmann number varied from Ha=0to 30 while the uniform magnetic field is considered horizontally. Results show that the heat transfer is decreased by the increment of Hartmann number for various Rayleigh numbers and the inclined angles. Magnetic field augments the effect of nanoparticles at high Rayleigh numbers. Negative inclined angles simultaneously decline heat transfer toward θ=0degree and the influence of nanoparticle.