Objective: The purpose of the study was to use the photonic imaging modality of optical coherence tomography (OCT) to compare the marginal adaptation of composite inlays fabricated by direct and indirect techniques. Material and Methods: Class II cavities were prepared on 34 extracted human molar teeth. The cavities were randomly divided into two on cavities with a composite (Esthet X HD, Dentsply, Germany) after isolating. The second group was indirectly restored with the same composite material. Marginal adaptations were scanned before cementation with an invisible infrared light beam of OCT (Thorlabs), allowing measurement in 200 mu m intervals. Restorations were cemented with a self-adhesive cement resin (SmartCem2, Dentsply), and then marginal adaptations were again measured with OCT. Mean values were statistically compared by using independent-samples t-test and paired samples t-test (p<0.05), before and after cementation. Results: Direct inlays presented statistically smaller marginal discrepancy values than indirect inlays, before (p=0.00001442) and after (p=0.00001466) cementation. Marginal discrepancy values were increased for all restorations after cementation (p=0.00008839, p=0.000000952 for direct and indirect inlays, respectively). The mean marginal discrepancy value of the direct group increased from 56.88 +/- 20.04 mu m to 91.88 +/- 31.7 mu m, whereas the indirect group increased from 107.54 +/- 35.63 mu m to 170.29 +/- 54.83 mu m. Different techniques are available to detect marginal adaptation of restorations, but the OCT system can give quantitative information about resin cement thickness and its interaction between tooth and restoration in a nondestructive manner. Conclusions: Direct inlays presented smaller marginal discrepancy than indirect inlays. The marginal discrepancy values were increased for all restorations that refer to cement thickness after cementation.