Ti 3 C 2 O 2 MXene has been found to have good NH 3 sensing ability and researchers are trying to modify its derivatives to improve its sensitivity. However, the effect of Ti 3 C 2 O 2 MXene doped with transition metals with comparable sizes on NH 3 sensitivity has not yet been studied. Herein, the density functional theory (DFT) method is used to investigate the sensitivity of pristine Ti 3 C 2 O 2 , Hf‐doped Ti 3 C 2 O 2 , Cd‐doped Ti 3 C 2 O 2 , and Cd–Hf codoped Ti 3 C 2 O 2 toward NH 3 . The adsorption energy of the optimized geometric structure is calculated to investigate the applicability and effectiveness of the modified Ti 3 C 2 O 2 MXene structure for NH 3 sensing. The adsorption energy of Hf–Cd codoped Ti 3 C 2 O 2 MXene surface is enhanced to −1.568 eV to NH 3 . In addition, the charge transfer analysis, adsorption height, energy band, and density of states are also considered. The reactivity of Ti 3 C 2 O 2 MXene surface for NH 3 adsorption is found to be greatly enhanced by Hf–Cd codoped Ti 3 C 2 O 2 MXene as demonstrated by the adsorption energies, optical and electronic properties.