From Here to Eternity is a the story of G Company, a United States military detachment stationed in Hawaii in 1941. The novel tracks the progress of strife, boredom, and abuse within the company as its constituent members engage in hazing, affairs, formal and informal competitions, and other clashes. The novel is concerned mainly with military culture and its impact on the human mind as expressed through the actions of soldiers in peaceful environments.
In February 1941, Private Robert E. Lee Prewitt, nicknamed "Prew," reports to his new posting at G Company, a US Army infantry unit stationed at Schofield Barracks in Hawaii. Prew is a career soldier (a "thirty-year man") with six years' service, an excellent bugler, and a former boxer. He was transferred from his last unit, a Bugle Corps, with a reduction to the lowest rank after complaining that a less skilled bugler, who was a friend (possibly a romantic partner) of the Chief Bugler, had been made First Bugler over him.
G Company's commanding officer is Captain Dana "Dynamite" Holmes, the regimental boxing coach, who chose Prew for his unit because of Prew's past history as a talented welterweight boxer. Holmes thinks that winning a boxing championship will greatly help his chances for promotion and concentrates on building a strong team, offering incentives such as promotions to men who box well. However, Prew swore off boxing after accidentally blinding his sparring partner and even transferred out of a past regiment to get away from boxing. Prew refuses to box for Holmes' team, resulting in his being given "The Treatment" by his platoon guide Sergeant Galovitch and others. "The Treatment" is a daily hazing ritual in which Prew is constantly singled out for extra drill exercises, unwarranted punishments, and undesirable work assignments in hopes of breaking him down through exhaustion. Despite the abuse, Prew stubbornly refuses to change his mind about boxing.
Holmes' First Sergeant Milt Warden is a career soldier, who, despite being only a non-commissioned officer, does most of the work of running the company while Captain Holmes is off pursuing either his promotion or women. Warden is both efficient at his job and understanding with the men under him. He comes to respect Prew, and at one point even stays out late getting drunk with him and then makes sure he gets home safely without being disciplined. Warden has also heard that Holmes' beautiful wife, Karen, has slept with a number of other men in his unit and begins an affair with her himself. Warden finds out that Karen's promiscuous behavior is due to her husband's cheating and giving her gonorrhea a few years after their marriage, forcing her to have a hysterectomy as part of the cure. Karen and Warden fall passionately in love, and Warden continues to see her in secret despite the risk to his career and a possible military prison sentence at Leavenworth if her husband finds out. Holmes realizes that his wife is having an affair but does not suspect that it is with Warden. Karen wants Warden to take a training course to become a commissioned officer so she can divorce Holmes and marry him, something that Warden feels would be improper on top of his already mixed feelings about officers. Over time, the strain of keeping the relationship secret also begins to put a damper on their feelings.
Prew befriends a new young recruit, Private Angelo Maggio, whose temper and impetuous behavior sometimes get him into trouble. Returning from a drunken night on the town, Prew and Maggio encounter military policemen (MPs), and Maggio fights them. As a result, Maggio is sentenced to a term in the stockade, the local military prison. At a local brothel catering to servicemen, Prew meets a beautiful prostitute, Lorene, whose real name turns out to be Alma Schmidt. Lorene is planning to save the money she makes and use it to establish herself in respectable society back in her Oregon hometown and eventually marry a man who is so respectable that no one would ever believe she had been a prostitute. Over time, she and Prew fall in love, but she refuses to marry him because she does not think he is respectable enough.
Just before the company's big boxing match, Prew gets into a fight with Private First Class Isaac Bloom, one of the boxers, and beats him so badly there is a concern that Bloom can no longer box. However, Bloom boxes and wins his match with a quick knockout. Later, Sergeant Galovitch attacks Prew with a knife while Prew is unarmed. Prew knocks out Sergeant Galovitch but refuses to testify that Galovitch had a knife; as a result, Prew is sentenced to three months in the Stockade. While Prew is in the Stockade, Bloom, a closet homosexual, commits suicide.
In the Stockade, Prew sees prisoners routinely beaten and abused by Staff Sergeant "Fatso" Judson, the prison second-in-command. Prew reconnects with Maggio, who is in the "Number Two" barracks where the hardest and most recalcitrant prisoners are kept. Maggio has undergone repeated beatings and solitary confinement in the prison and is now hardened as a result. Prew schemes to be transferred into Number Two by committing an infraction and then being beaten and then spending time in the "Black Hole," a dark solitary confinement cell where prisoners are fed minimal bread and water rations. When he comes out, he is placed in Number Two and forms a camaraderie with the other prisoners there. Maggio finally schemes to get out of the prison and out of the Army altogether by pretending to have gone crazy. He is repeatedly beaten for many days by Judson, who strongly suspects that he is faking and is trying to get him to admit it. Judson fails to get an admission out of Maggio although Maggio manages to get a message back to his friends that he is all right. Maggio is finally given a Section 8 dishonorable discharge, and Prew never sees him again.
Judson interrogates one of the other Number Two prisoners, Blues Berry, and ends up torturing and beating Berry to death in front of his Number Two barracks mates including Prew. Prew vows to kill Judson when he himself is released. Shortly thereafter, Prew is released and returns to Company G, which is much changed. Holmes received a promotion and left the company, and Galovitch was reduced in rank after the knife fight incident. After a few days, Prew goes into town, finds Judson, challenges him to a knife fight, and kills him, but Prew sustains severe injuries. He goes AWOL to Alma's house to recover and stays there after he is well even though his relationship with Alma is slowly deteriorating. Prew no longer wishes to make the Army his career but has no other ideas about what he might do, and Alma is making plans to return to Oregon without him. Prew is afraid of imprisonment for killing Judson, but during a clandestine meeting with Warden, he finds out he has not been suspected in the killing. However, Warden tells Prew he might have to serve a month in the Stockade for the time he spent AWOL, causing Prew to go back into hiding at Alma's to avoid returning to the Stockade.
The Japanese suddenly attack Pearl Harbor although most of the damage is done at the harbor and Hickam Field rather than the Schofield Barracks. Prew decides he must return to his unit and says goodbye to Alma forever. On the way back, he is stopped by guards and because he has no identification, they begin to arrest him. Not wanting to go back to the Stockade, he runs and is shot dead. Warden comes to identify him and collect his personal effects.
Warden is promoted to Second Lieutenant in the Reserve Corps, thus attaining commissioned officer status. He bids a fond farewell to Karen since he will be involved in combat in World War II, and she is returning to the mainland United States. The two are sad to be breaking up but better off for having known and loved each other. On the ship leaving Hawaii, Karen meets a beautiful and elegantly dressed girl, who says that she was an executive secretary on the island and that her fiance, named Robert E. Lee Prewitt and from "an old Virginia family", was a bomber pilot killed in the attack on Hickam Field who posthumously received the Silver Star. Karen, told by Warden about Prew, realizes that the girl is the former prostitute, Lorene.