Two-dimensional titanium carbide (called MXene) has been utilized to fabricate a highly sensitive electrochemical sensor for the determination of capsaicin. In the present work, Ti3C2Tx MXene was dispersed in the composite solution of sol–gel derived titania and Nafion. The as-prepared MXene-titania-Nafion composite solution was drop-cast on the surface of a glassy carbon (GC) electrode. Due to the electrostatic interaction between positively charged capsaicin at pH 1.0 and negatively charged MXene-titania-Nafion composite film, capsaicin was selectively adsorbed onto the present electrochemical sensor. The introduction of MXene in the titania-Nafion composite film on GC electrode significantly increased the oxidation current of capsaicin compared to that at a bare GC electrode and the titania-Nafion composite-modified GC electrode, which could be attributed to the synergistic effect of Ti3C2Tx MXene and mesoporous titania-Nafion composite film. The experimental parameters affecting the detection capability of capsaicin (i.e., pH, MXene loading amount and accumulation time) were optimized. Using the linear sweep adsorptive stripping voltammetry, the present electrochemical sensor based on the MXene-titania-Nafion composite film can detect capsaicin from 5.0 × 10−8 M to 2.5 × 10−5 M with a detection limit of 2.5 × 10−8 M (S/N = 3). Furthermore, the present electrochemical sensor exhibited good selectivity towards capsaicin against interfering species like glucose and organic acids. Recovery tests for spiked capsaicin in a real pepper sample showed good recoveries. Therefore, the present electrochemical sensor based on the MXene-titania-Nafion composite could be applied to the voltammetric determination of capsaicin in food and pharmaceuticals.