Porosity and voids are a type of defect that may appear during the manufacturing of composite structures. Its possible presence is checked in production parts by different non-destructive techniques based on ultrasonic inspection. It is important to perform this evaluation considering that a high content of these defects decrease the mechanical properties compared to the original design. In recent years, optical microscopy of composite materials has become a very powerful tool, which is available for the industry to inspect and look at the internal structure and help to reach conclusions in the field of quality, failure analysis and I+D+I. In addition, the use of automatic scanning techniques of wide cross sections has opened the possibility of quantifying the percentage of porosity/voids, as well as become an alternative to more laborious testing procedures such as acid digestion of the resins. This study contributes to existing test standards within the aeronautical sector, in the sample preparation strategy. For this purpose, samples of epoxy matrices with carbon fibers, both unidirectional and fabric tapes have been analyzed to evaluate the influence of the quality of sample preparation, the stacking sequence and the initial porosity levels, the repeatability of the measurements and the quality of the results. An attempt has been made to correlate the results with standar physical / chemical analysis.