An apparatus for inspecting a substrate for detecting a foreign substance comprising: a projecting part (300, 400) configured to provide at least one grid pattern light onto the substrate; a lighting part configured to provide a plurality of color lights onto the substrate; an image capturing part configured to capture at least one image of the substrate and a foreign substance on the substrate by receiving the grid pattern light and the color lights reflected by the foreign substance and the substrate; the apparatus further comprising: an infrared lighting to provide infrared light onto the substrate and a processing part connected to the image capturing part for receiving and processing the at least one image captured by the image capturing part, the processing part being configured to obtain 3-dimensional image information including height of the substrate by using the grid pattern light, detect a foreign substance of the substrate by using the 3-dimensional image information including height, obtain 2-dimensional image information of the substrate per color by using the color lights, detect a foreign substance of the substrate by using the 2-dimensional image information per color, combine a detection result of a foreign substance performed by using the 3-dimensional image information including height and a detection result of a foreign substance performed by using the 2-dimensional image information per color, and wherein the processing part is configured to: obtain, before detecting a foreign substance of the substrate, mask information about the substrate by using the infrared lighting; and exclude, from the the at least one image, a region formed on the substrate and which may be wrongly considered as a foreign substance or a region formed on the substrate and which is necessary to be removed from the substrate to be detected by using a mask that is generated based on the mask information. a lighting part configured to provide a plurality of color lights onto the substrate; an image capturing part configured to capture at least one image of the substrate and a foreign substance on the substrate by receiving the grid pattern light and the color lights reflected by the foreign substance and the substrate; the apparatus further comprising: an infrared lighting to provide infrared light onto the substrate and a processing part connected to the image capturing part for receiving and processing the at least one image captured by the image capturing part, the processing part being configured to obtain 3-dimensional image information including height of the substrate by using the grid pattern light, detect a foreign substance of the substrate by using the 3-dimensional image information including height, obtain 2-dimensional image information of the substrate per color by using the color lights, detect a foreign substance of the substrate by using the 2-dimensional image information per color, combine a detection result of a foreign substance performed by using the 3-dimensional image information including height and a detection result of a foreign substance performed by using the 2-dimensional image information per color, and wherein the processing part is configured to: obtain, before detecting a foreign substance of the substrate, mask information about the substrate by using the infrared lighting; and exclude, from the the at least one image, a region formed on the substrate and which may be wrongly considered as a foreign substance or a region formed on the substrate and which is necessary to be removed from the substrate to be detected by using a mask that is generated based on the mask information. obtain, before detecting a foreign substance of the substrate, mask information about the substrate by using the infrared lighting; and exclude, from the the at least one image, a region formed on the substrate and which may be wrongly considered as a foreign substance or a region formed on the substrate and which is necessary to be removed from the substrate to be detected by using a mask that is generated based on the mask information.