The present investigation assessed the effect of acid etching on marginal adaptation of white- and gray-colored mineral trioxide aggregate (MTA) to apical dentin using microcomputed tomography (micro-CT) and scanning electron microscopy (SEM). Sixty-four extracted single-rooted human maxillary teeth were used. Following root-end resection and apical preparation, the teeth were equally divided into four groups according to the following root end filling materials: (i) white-colored MTA (WMTA), (ii) etched WMTA (EWMTA), (iii) gray-colored MTA (GMTA) and (iv) etched GMTA (EGMTA). After 48 h, the interface between root-end filling materials and the dentinal walls was assessed using micro-CT and SEM. Data were statistically analyzed using the Kruskal–Wallis and Dunn tests. Micro-CT analysis revealed gap volumes between the apical cavity dentin walls and EGMTA, GMTA, EWMTA and WMTA of (0.007 1±0.004) mm3, (0.053±0.002) mm3, (0.003 6±0.001) mm3 and (0.005 9±0.002) mm3 respectively. SEM analysis revealed gap sizes for EGMTA, WMTA, EWMTA and GMTA to be (492.3±13.8) µm, (594.5±17.12) µm, (543.1±15.33) µm and (910.7±26.2) µm respectively. A significant difference in gap size between root end preparations filled with GMTA and EGMTA was found (P<0.05). No significance difference in gap size between WMTA and EWMTA were found in either SEM or micro-CT analysis. In conclusion, pre-etching of apical dentin can provide a better seal for GMTA but not for WMTA.