To evaluate and compare the influence of dissimilar CAD-CAM material on the marginal fitness of endocrown with different cavity depths. Freshly extracted human maxillary first premolar teeth (n = 40) were selected for this study. Teeth were decapitated 2 mm above the cement-enamel junction from proximal surface and endodontic treatment were performed for all teeth. Samples were allocated at two main groups (n = 20), according to cavity depth. Group A: 2 mm cavity depth; Group B: 4 mm cavity depth; and further subdivided into two sub-groups according to material used (n = 10): (A1 and B1) resin-based material; (A2 and B2) ceramic-based material. Teeth were prepared with butt joint margin and 10° internal axial wall divergence. Afterwards, samples scanning was performed using InLab digital scanner. Endocrown restoration fabricated by Sirona Cerec InLab MCXL milling device and adhesively luted with a resin cement (RelyX™ Ultimate ClickerTM, 3 M ESPE). All samples were subjected to thermocycling. After thermocycling, marginal gaps were measured using stereomicroscope at a magnification of 45X. The recorded measurements were collected, scaled and statistically analyzed. A resin-based endocrown showed significantly a smaller vertical marginal gap than ceramic-based, an endocrown with 2-mm cavity depth showed significantly lower marginal gap than one with 4-mm cavity depth. Increasing the cavity depth of endocrown preparation negatively affect the marginal fit. Resin-nanoceramic endocrown showed better marginal fit than glass ceramic endocrown. Both tested CAD/CAM materials showed clinically acceptable vertical marginal gap.