Kim (Kimball O'Hara) is the orphaned son of an Irish soldier and a poor white mother who have both died in poverty. Living a vagabond existence in India under British rule in the late 19th century, Kim earns his living by begging and running small errands on the streets of Lahore. He occasionally works for Mahbub Ali, a horse trader who is one of the native operatives of the British secret service. Kim is so immersed in the local culture, few realise he is a white child, though he carries a packet of documents from his father entrusted to him by an Indian woman who cared for him.
Kim befriends an aged Tibetan Lama who is on a quest to free himself from the Wheel of Things by finding the legendary 'River of the Arrow'. Kim becomes his chela, or disciple, and accompanies him on his journey. On the way, Kim incidentally learns about parts of the Great Game and is recruited by a British officer to carry a message to the British commander in Umballa. Kim's trip with the Lama along the Grand Trunk Road is the first great adventure in the novel.
By chance, Kim's father's regimental chaplain identifies him by his Masonic certificate, which he wears around his neck and Kim is forcibly separated from the Lama. The Lama insists that Kim should comply with the chaplain's plan because he believes it is in Kim's best interests and the boy is sent to a top English school in Lucknow. The Lama funds Kim's education and Kim remains in contact with this Holy Man he has come to love throughout his years at school. Kim also retains contact with his secret service connections and is trained in espionage while on vacation from school by Lurgan Sahib, at his jewellery shop in Simla. As part of his training, Kim looks at a tray full of mixed objects and notes which have been added or taken away, a pastime still called Kim's Game, also called the Jewel Game.
After three years of schooling, Kim is given a government appointment so that he can begin his role in the Great Game. Before this appointment begins however, he is granted time to take a much-deserved break. Kim rejoins the Lama and at the behest of Kim's superior, Hurree Chunder Mookherjee, they make a trip to the Himalayas. Here the espionage and spiritual threads of the story collide, with the Lama unwittingly falling into conflict with Russian intelligence agents. Kim obtains maps, papers, and other important items from the Russians working to undermine British control of the region. Mookherjee befriends the Russians under cover, acting as a guide and ensures that they do not recover the lost items. Kim, aided by some porters and villagers, helps to rescue the Lama.
The Lama realizes that he has gone astray. His search for the 'River of the Arrow' should be taking place in the plains, not in the mountains, and he orders the porters to take them back. Here Kim and the Lama are nursed back to health after their arduous journey. Kim delivers the Russian documents to Hurree, and a concerned Mahbub Ali comes to check on Kim. The Lama finds his river and achieves Enlightenment. The reader is left to decide whether Kim will henceforth follow the prideful road of the Great Game, the spiritual way of Tibetan Buddhism, or a combination of the two. Kim himself has this to say: "I am not a Sahib. I am thy chela."