The Years of Rice and Salt is an alternate history novel by American science fiction author Kim Stanley Robinson, published in 2002. The novel explores how world history might have been different if the Black Death plague had killed 99 percent of Europe's population, instead of a third as it did in reality. Divided into ten parts, the story spans centuries, from the army of the Muslim conqueror Timur to the 21st century, with Europe repopulated by Muslim pioneers, the indigenous peoples of the Americas forming a league to resist Chinese and Muslim invaders, and a 67-year-long world war being fought primarily between Muslim states and the Chinese and their allies. While the ten parts take place in different times and places, they are connected by a group of characters that are reincarnated into each time but are identified to the reader by the first letter of their name being consistent in each life.

The novel explores themes of history, religion, and social movements. The historical narrative is guided more by social history than political or military history. Critics found the book to be rich in detail, plausible, and thoughtful. The Years of Rice and Salt won the Locus Award for Best Science Fiction Novel in 2003. In the same year it was nominated for the Arthur C. Clarke Award, a Hugo Award, and a British Science Fiction Award.

Background At the time of publication in 2002, science fiction author Kim Stanley Robinson was 49 years old and living in Davis, California. He had conceived of the premise for The Years of Rice and Salt in the 1970s while thinking about what alternate history scenario would result in "the biggest change that would still work in terms of comparison to our history". He subsequently developed an interest in China and in Buddhism, which he would study for this project.

Robinson's only other alternate history story prior to this project was the short story "The Lucky Strike" (1984), where the Enola Gay crashes in a training exercise and the secondary crew must complete the Hiroshima bombing.

Robinson also wrote an essay titled "A Sensitive Dependence on Initial Conditions" (1991), comparing different theories of history and laws of science, such as the covering law model, to explain how alternate histories can be arrived at, using "The Lucky Strike" as an example.

He explored the idea of non-Western influences creating a new culture while working on his Mars trilogy, which involved a heavy Muslim influence in a Martian colony. The Mars trilogy gave Robinson a reputation for quality of writing and a richness of detail comparable to James Michener, as well as winning him a Nebula Award for Red Mars (1993) and two Hugo and Locus Awards for Green Mars (1994) and Blue Mars (1996). Robinson followed the Mars trilogy with the novel Antarctica (1997), which won an Alex Award, and two short story collections, The Martians (1999) and Vinland the Dream (2001), before publishing The Years of Rice and Salt.

Plot The story is divided into ten parts.

Book One: Awake to Emptiness Bold and Psin, scouts in Timur's army, discover a Magyar city where all the inhabitants have died from a plague. Timur turns his army around and orders the scouting party executed to avoid the plague, but Bold escapes and wanders through the dead lands of Eastern Europe, encountering only one lone native. Upon reaching the sea he is captured by Turkish Muslim slave traders and sold to Zheng He's Chinese treasure fleet. Bold befriends a young African slave, named Kyu, whom he cares for after the Chinese castrate him.

In China, they are kept as kitchen slaves until Kyu burns the restaurant and convinces Bold to escape with him. The pair make their way north to Beijing where they find work at the palace of Zhu Gaozhi, heir to the Yongle Emperor. The vengeful Kyu, hating the Chinese for what they have done to him, incites violence between the eunuchs and the Confucian administrative officials. After his scheming is discovered, Kyu is assassinated.

Kyu and Bold reunite in the bardo, where Bold explains to Kyu the concepts of cyclical reincarnation alongside one's jati. He explains that their jati also includes Psin, the restaurant owners Shen and I-li, and an unknown number of others, and that their group has been especially close since an avalanche in Tibet killed them all at once in a previous cycle. Kyu resolves to do better in his next life.

Book Two: The Haj in the Heart In Mughal India, two Hindu girls named Kokila and Bihari grow up together studying traditional medicine. Kokila is married to the son of an unpopular village headman. Her husband's brother gets Bihari pregnant, and Kokila is too late to save her from dying in a miscarriage. In revenge, Kokila uses her knowledge of herbs to fatally poison her brother-in-law and father. She is executed for her crime.

Kokila reincarnates as a tiger named Kya, who saves Bistami, a Sufi mystic of Persian origin, from an attack by Hindus. After seeing Bistami beaten by his older brother, Kya kills the brother, and is trapped and killed by the villagers in retaliation.

Bistami goes on to become a judge for the Mughal Emperor Akbar, but later falls into his disfavour and is exiled to Mecca. Bistami spends a year in Mecca before learning that he is being blamed for Akbar forsaking Islam, and departs again, traveling to the Maghreb and Iberia (Al-Andalus). Accompanied by Ibn Ezra, a follower of the historian Ibn Khaldun, Bistami joins a caravan led by Sultan Mawji and his wife Katima, who seek to found a new city on the other side of the Pyrenees.

The caravan members found a city called Baraka on the abandoned former site of Bayonne, France, and create a model society based on Katima's feminist interpretation of the Quran. After Mawji dies, Katima rules the community on her own. Believing this to be heresy, the Caliph of Al-Andalus sends an army against Baraka. Bistami, Katima, Ibn Ezra, and their remaining followers flee again, this time founding the city of Nsara (near Nantes, France).

Book Three: Ocean Continents The Wanli Emperor orders a fleet under Admiral Kheim to invade Nippon (Japan). When the wind fails to arrive, the huge fleet is swept out to sea by the Kuroshio Current and set adrift on the unexplored Pacific Ocean. Deciding that their only hope of returning home is to ride the North Pacific Gyre, the fleet navigates all the way to the New World.

The sailors land on the West coast of North America and make contact with the peaceful Miwok people. Kheim befriends a girl named Butterfly and begins teaching her to speak Chinese. Once Kheim discovers they have infected the indigenous people with disease, he orders his crew to leave at once, but a sailor named Peng jumps ship to remain with his Miwok lover. Butterfly comes aboard the fleet, intending to voyage with Kheim back to China.

Continuing south, Kheim's fleet encounters the Inca Empire. They are taken prisoner, and both Kheim and Butterfly are set to be ritually sacrificed; Kheim escapes by awing the natives with his flintlock pistol. On the return trip to China, Butterfly is fatally injured during a storm and soon dies. Kheim tells the Emperor that the Inca are militarily weak and rich in gold. In the bardo, a grieving and enraged Kheim attacks the goddess Kali with his sword, but is unable to wound her.

Book Four: The Alchemist Khalid, an alchemist from Samarkand during the Bukhara Khanate, attempts to fool the Khan into believing that he has discovered the Philosopher's stone. The Khan's aide discovers the fraud and Khalid's hand is severed as punishment. Khalid becomes disenchanted with alchemy and decides to destroy all his books. His friend Iwang, a Tibetan Buddhist mathematician, and son-in-law Bahram, a Sufi blacksmith, instead convince Khalid to test the claims in the books through practical experiments, particularly those of Aristotle.

Khalid and Iwang devote themselves to demonstrations that use the scientific method to greatly progress knowledge of physics, chemistry, mathematics, biology, and weaponry. Their discoveries inspire Samarkand's other madrasa scholars to conduct scientific investigations of their own. However, the Khan still sees Khalid as a con artist, and demands that he prove his worth by inventing new weapons to fight the rising Chinese threat to the East. The Chinese attack never comes; in the end, everyone at Khalid's lab is killed by an outbreak of plague, implied to have resulted from the Khan's refusal to listen to Khalid and Iwang's suggestions to improve the city's sanitation.

Book Five: Warp and Weft The Iroquois people, referred to throughout by their own name of Hodenosaunee (People of the Longhouse) hold a ceremony to raise a foreigner named Fromwest to the rank of Chief. After distinguishing himself in a game of lacrosse, Fromwest tells the story of how he came to the northeast of the continent he calls Yingzhou. Formerly a samurai named Busho, he fled to the New World after the Chinese conquered Japan. He was eventually captured by a war party of Sioux and rescued by warriors from the Seneca people.

In an ecstatic vision, Fromwest appears to remember his past lives. He realizes that Peng (from "Ocean Continents") made his way to the Hodenosaunee and taught them about variolation, blunting the impact of smallpox epidemics on their civilization. Fromwest reveals that he has come to organize the Hodenosaunee into a larger defensive alliance capable of resisting Chinese and Muslim colonizers, and offers to teach them how to mass-produce their own firearms.

After their next deaths, the jati members apply scientific reasoning to the bardo, and manage to resist drinking the tonic of forgetting before being reincarnated.

Book Six: Widow Kang During the reign of the Qianlong Emperor, Chinese widow Kang Tongbi takes in a Buddhist monk and his son whom she finds scavenging. The monk, Bao Ssu, is wrongly implicated in a series of queue cuttings and dies in prison. Later, Kang meets a Hui Muslim scholar named Ibrahim ibn Hasam, and they perform a ritual that allows them to remember their past lives.

Kang and Ibrahim marry and move to Lanzhou in western China, where they work to try to reconcile Islamic and Confucian beliefs. Kang anthologizes proto-feminist poetry and becomes a well-known writer. The Jahriyya Islamic movement gains adherents in the west but faces intolerance from the Qing administration, leading to a revolt that the Qing crush with massive force. Lanzhou is swamped by a dramatic flood; Bao Ssu's son rescues a pregnant Kang from the rising waters. In a work based on Kang's ideas, Ibrahim publishes his thoughts on the Four Great Inequalities: warriors and priests over farmers, men over women, men over children, and certain races over other races.

Book Seven: The Age of Great Progress In the equivalent of the Christian 19th century, the Indian state of Travancore has overthrown the Mughals and the Safavids and developed steam engines, ironclad warships, and military balloons. Using these new weapons, they sail to Kostantiniyye and easily topple the Ottoman Empire. A Muslim Armenian doctor named Ismail ibn Mani al-Dir, who had served the Ottoman Sultan, is captured and sent to Travancore, where he happily joins the hospital of Travancore and works in anatomy and physiology. Ismail eventually meets their ruler, the Kerala of Travancore, who aims to drive out the Muslim invaders and unify India—and eventually the whole world—into a democratic confederation.

Later, during the Xianfeng Emperor's reign, the Japanese enclave known as Gold Mountain (in the real-world San Francisco Bay Area) has been subjugated by Chinese colonists. A Japanese slave named Kiyoaki is swept out to sea by the Great Flood of 1862. Along with a pregnant Chinese refugee, Peng-ti, Kiyoaki manages to flee to the great coastal city of Fangzhang. There, Kiyoaki joins a Japanese freedom movement supported by Travancore, with Ismail acting as a liaison.