Background Transversus abdominis plane (TAP) block and epidural analgesia are two frequently used regional anaesthesia techniques that attenuate postoperative pain after inguinal hernia repair. Aim To compare the analgesic efficacy between the single-shot epidural block and TAP block for postoperative analgesia in patients undergoing inguinal hernia repair surgery. Methods Forty patients of either gender undergoing elective inguinal hernia surgery of American Society of Anesthesiologists (ASA) class Ⅰ and Ⅱ were randomly allocated into two groups. Group E received a single-shot epidural with 20 ml of 0.25% bupivacaine. Group T received a TAP block with 20 ml of 0.25% bupivacaine under ultrasound guidance. Postoperative pain was evaluated by the visual analog scale (VAS). Rescue analgesia was given on VAS score ≥ 4 or on-demand in the postoperative period. The primary outcome included VAS score at 15 min, 1st h, 2nd h, 6th h, 12th h, and 24th h after the block. The secondary outcome was the analgesia duration, the total rescue analgesia dose required, and the patient satisfaction level. Results The VAS pain scores were significantly lower in the epidural group compared to the TAP group at the 2nd, 6th, 12th, and 24th h postoperatively (p<0.0001). The mean duration of analgesia was significantly more in Group E (576.75±96.64 min) compared to Group T (276.75±105.56 min). The total analgesic consumption was seen significantly more in 24 h in Group T than in Group E. Patient satisfaction score was significantly higher with a mean value of 5.55±0.6 in group E compared to 4.75±0.72 in group T. Conclusion A single-shot epidural provides better postoperative pain control than a TAP block. The duration of the first analgesic demand was prolonged, with less analgesic consumption in the epidural group.