The presence of mental fatigue seriously affects daily life and working conditions. Non-invasive transcranial electrical stimulation has become an increasingly popular tool for relieving mental fatigue. We investigated whether transcranial direct current stimulation (tDCS) and transcranial alternating current stimulation (tACS) could be used to alleviate the state of mental fatigue in a population of healthy young adults and compared their effects. We recruited 10 participants for a blank control, repeated measures study. Each participant received 15 min of anodal tDCS, α-tACS, and blank stimulation. Participants were required to fill in the scale, perform the test task and collect ECG signals in the baseline, fatigue and post-stimulus states. We then assessed participants' subjective fatigue scale scores, test task accuracy and HRV characteristics of ECG signals separately. We found that both anodal tDCS and α-tACS significantly (P < 0.05) reduced subjective fatigue and improved accuracy on the test task compared to the blank group, and the extent of change was greater with tACS. For the HRV features extracted from ECG signals. After tACS intervention, SDNN (t = -3.241, P = 0.002), LF (t = -3.511, P = 0.001), LFn (t = -3.122, P = 0.002), LFn/HFn (-2.928, P = 0.005), TP (t = -2.706, P = 0.008), VLF (t = -3.002, P = 0.004), SD2 (t = -3.594, P = 0.001) and VLI (t = -3.564, P = 0.001) showed a significant increasing trend, and HFn (t = 3.122, P = 0.002), SD1/SD2 (t = 3.158, P = 0.002) and CCM_1 (t = 3.106, P = 0.003) showed a significant decreasing trend. After tDCS intervention, only one feature, TINN, showed a significant upward trend (P < 0.05). The other features showed non-significant changes but roughly the same trend as the tACS group. Both tDCS and α-tACS can be effective in relieving mental fatigue, and α-tACS is more effective than tDCS. This study provides theoretical support for tDCS with α-tACS having a alleviating effect on mental fatigue and the use of ECG as a valid objective assessment tool.