The novel is set at Maxton Hall, one of England's most elite private schools, where scholarship student Ruby Bell has spent two years making herself invisible. Ruby is the first in her working-class family to aim for university, and her singular goal is admission to Oxford to study Philosophy, Politics, and Economics. She maintains a strict boundary between her modest home life and the wealth-saturated world of the school. Her mother works at a bakery, her father, Angus, uses a wheelchair after a boating accident that also left Ruby with a severe phobia of water, and her younger sister, Ember, runs a plus-size fashion blog. Ruby keeps her family entirely separate from Maxton Hall after a humiliating parents' evening where her mother and father were treated with open condescension.
Ruby's careful anonymity shatters when she goes to collect a university reference letter from her young history teacher, Mr. Graham Sutton, and walks in on him kissing Lydia Beaufort, a student in Ruby's class and the daughter of the family behind one of England's oldest and most powerful menswear companies. Ruby flees, resolved to keep quiet and avoid entanglement with the Beauforts.
Lydia's twin brother, James Beaufort, learns of the situation and confronts Ruby at school. He tries to bribe her with thousands of pounds in cash, then crudely offers himself sexually as payment. Ruby is furious, throwing the money in the air and telling James her only price is to be left alone. James, surrounded his entire life by people angling for access to his family's wealth, cannot comprehend someone who genuinely wants nothing from him.
James's reckless streak soon creates a direct collision. He arranges for strippers and exotic dancers to crash the school's Back-to-School party, which Ruby and her best friend and co-leader Lin Wang spent the summer organizing. One dancer performs a lap dance on Ruby as a "gift" from James, publicly humiliating her. The headmaster, Mr. Lexington, suspends James from the lacrosse team for the rest of term and orders him to serve on the events committee under Ruby's supervision. Lacrosse is the one thing James is passionate about; he built the school team from nothing into three-time champions over six years, and losing it devastates him.
Forced into close proximity, Ruby and James clash constantly at first, but James gradually begins contributing in earnest, proposing a Victorian-themed Halloween party that the team unanimously adopts. Ruby needs authentic Victorian costumes for the party's promotional materials and asks James for access to the Beaufort company archives. They travel to London together, sharing ice cream and personal confidences during the ride. At the Beaufort flagship store, they try on original Victorian garments from 1857 and share a charged, intimate moment during a photoshoot. When James's parents, Mortimer and Cordelia Beaufort, arrive unexpectedly, everything shifts. His father regards Ruby with cold dismissal, and James turns abruptly distant, having Ruby escorted out of the building.
Ruby tells James she would rather return to the days when he did not know she existed. But James shows up at her house days later to apologize, admitting he does not understand his own behavior and telling Ruby she is no longer invisible to him. Ruby warily accepts.
Their tentative connection deepens at a party hosted by James's friend Cyril Vega, where Cyril grabs Ruby and throws her into the pool as a joke, triggering a full panic attack rooted in her childhood trauma. James dives in and pulls her out, carries her from the party, and holds her hand the entire drive home. Ruby tells him about the boating accident that left her father permanently using a wheelchair and herself terrified of water.
Over the following weeks, James walks Ruby into school and teaches her to project indifference to deflect gossip. On Ruby's eighteenth birthday, James sends her a monogrammed Beaufort leather satchel, and they talk on the phone until three in the morning. James confesses he does not want to take over the family company or attend Oxford but feels his life has been entirely scripted for him. Ruby tells him everybody deserves a world full of possibilities. Privately, Ruby meets with Lexington and argues that James has earned early release from the events committee and should return to lacrosse. She acts because James's confession revealed that his final year at school is his last window of freedom before family obligations consume his life. Lexington agrees, effective after the Halloween party.
The Victorian Halloween party is a resounding success. James asks Ruby to dance, and when a blown fuse plunges the room into darkness, they go to the cellar together to fix it. On the stairs, the tension between them breaks: James pulls Ruby to him and kisses her. Mortimer Beaufort interrupts from the top of the stairs, coldly ordering James to his mother.
In the car home, James's parents berate him. His mother calls Ruby "a scholarship girl from a working-class background" and suggests Elaine Ellington, the older sister of James's close friend Alistair, as a more suitable match. His father calls Ruby a "gold digger." Once home, Mortimer strikes James across the face, drawing blood. James retreats to the house of Wren Fitzgerald, one of his closest friends, where his inner circle confronts him, accusing him of changing because of Ruby and abandoning their pact to enjoy their final year together. James concludes he and Ruby do not fit and that the kiss was a mistake.
The following Monday, James ignores Ruby completely. When she confronts him at the lacrosse field, he tells her coldly that the kiss was merely gratitude for getting him back on the team. Ruby is devastated. She sends the bag back with his birthday card, on which she has written "Fuck you" beneath his original message.
Ruby reverts to total invisibility while James carries her card in his wallet, unable to stop thinking about her. Meanwhile, Lydia confides in James about her full history with Graham Sutton: They met anonymously online over two years ago, fell in love through months of messaging, and began a relationship that Sutton ended when he took a permanent post at Maxton Hall. James recognizes how parallel their situations are.
Ruby receives an interview invitation from St. Hilda's College, Oxford, and discovers James is staying in the room directly opposite hers. Her first interview goes well; her second is a disaster. During her visit, Ruby discovers that Lydia is twelve weeks pregnant with Graham Sutton's baby and promises to keep the secret. After the disastrous interview, James provokes Ruby during a group session, and she explodes publicly, calling him a coward who only does what his parents want. Their furious argument transforms into a desperate kiss. James carries her to his room, and they sleep together for the first time. Afterward, James tells her the full truth: His parents saw her as a threat, his father struck him, and he convinced himself he could never protect her from his family. Ruby forgives him but warns she will not forget. Together, they write a list of things James wants from life: travel, lacrosse, reading, a fulfilling career, and item five, simply "Ruby."
James and Lydia return home from Oxford to learn that their mother died of a stroke two days earlier. Their father deliberately withheld the news so their interviews would not be disrupted. James attacks Mortimer before the chauffeur restrains him, then spirals into a binge of alcohol and cocaine at Cyril's house. Lydia arrives at Ruby's home searching for James, and Ruby accompanies her to Cyril's. There, Ruby finds James drugged and unresponsive and watches helplessly as Elaine Ellington kisses him while he offers no resistance. Cyril whispers, "Now that's the James Beaufort I know." Ruby tells Lydia she cannot do this and walks out. The door slams shut behind her as she concludes she will never be part of James's world.