At his youth, Khairul Fahmi began his football career playing for the Kelantan President's Cup team in 2006. He was the team's first choice goalkeeper for his side when they reached finals in the 2006–07 President Cup tournament. However, Kelantan later lost by penalties.
Khairul Fahmi was later chosen to be in the Harimau Muda team for the 2008 Malaysia Premier League season, alongside Fakri Saarani. Khairul Fahmi appeared in all 24 matches as Harimau Muda finished in 8th place.
Khairul Fahmi had also impressed the Dutch club, PSV Eindhoven and went for a-week trials with the club's Under-19 and Under-23 teams. He went there with his teammate, Asraruddin Putra after they showed excellent performances in the 2007 Champions Youth Cup.
Return to Kelantan
In 2009, Khairul Fahmi returned to Kelantan and registered for senior squad at the age of 20. He was the youngest goalkeeper ever to play for the Kelantan senior team. He made his appearances for senior squad after silly mistake from Syed Adney during their match against Kedah in Malaysia Super League. In 2010, he was part of the Kelantan's2010 Malaysia Cup winning team. He also won The Best Young Player and Best Goalkeeper awards at the 2010 Anugerah Bola Sepak Kebangsaan 100Plus-FAM.
Melaka United
On 7 May 2018, Khairul Fahmi signed a six-month contract with Melaka United until the end of the current season. On 12 May 2018, Khairul Fahmi made his debut for Melaka United in a 0–0 draw against Perak.
Khairul Fahmi made his first appearance for Malaysia under-23 at the 2010 Asian Games. He helped his team qualify into the second round but later lost to Iran, 1–3. Khairul Fahmi became Malaysia's hero when he saved two penalties and they won 4–3 in the penalty shootout after a 1–1 draw against Indonesia to ensure Malaysia retained the prestigious SEA Games gold medal. Khairul Fahmi also helped his team qualify into the Men's Asian Qualifiers Preliminary Round 3 of 2012 Summer Olympics Qualification. However, Malaysia failed to win any matches in the group stage.
Malaysia senior national team
Khairul Fahmi made his debut against Oman on 3 September 2010 replacing Sharbinee Allawee during the second half. He kept a clean sheet for the entire second half after Malaysia conceding 3 goals in the first half of the match. In November 2010, Khairul Fahmi was called up to the Malaysia national team by coach K. Rajagopal for the 2010 AFF Suzuki Cup. Khairul kept a clean sheet against Thailand on a 0–0 draw. He also kept a clean sheet against Vietnam twice in the semi finals. In the first leg of the finals, Khairul Fahmi played well against the Indonesians. The match ended a 3–0 win to Malaysia, thus earning another clean sheet to him. In the second leg of the finals held in Indonesia, Khairul Fahmi gave another outstanding performance by making numerous saves including a brilliant penalty save early in the match. The save proved to be a pivotal moment in the match in which Malaysia scored an away goal. Malaysia won on 4–2 aggregate and lifted the 2010 AFF Suzuki Cup title for the first time. Khairul Fahmi was selected for the 2012 AFF Suzuki Cup. On 26 November2012, Malaysia's opening group match against Singapore ended up with the Malaysian side losing 0–3. The Lions scored the first goal through their captain, Shahril Ishak at the 32nd-minute. Six minutes later, Ishak once again scored a goal for the Lions as a result of Khairul Fahmi's blunder at goal. In the second half, veteran Singaporean forward Aleksandar Đurić completed the rout against the Tigers with the third and final goal of the game. The match resulted in 2012 AFF Suzuki Cup holders Malaysia losing its first group match of the tournament, and Khairul Fahmi was subsequently dropped for the rest of the Tigers' campaign.
Khairul Fahmi is the fourth of five siblings. He received his early education at the Sekolah Kebangsaan Tapang, Kota Bharu. Then he entered Sekolah Sukan Bandar Penawar, Johor Bahru. After that he furthered Bukit Jalil Sports School. He was active in sports and has represented the school since primary school. On 28 December 2012, Khairul Fahmi married Nur Eilunie Natasha Jaafar. They have a daughter named Kayla Elayna, and a son named Khaleel Emir.
Don't watch clock do what it does. Keep going, only you can change your life, no one can do it for you, and don't afraid to fail but be afraid not to try. Excuses don't get results so don't talk just act, show, and prove!!