For months, he also wrote vaguely about using guns to carry out his "exit plan" at his health club, where lots of young women worked out.
On Tuesday, Sodini put his plan into action.
He went to the sprawling L.A. Fitness Club in this Pittsburgh suburb, turned out the lights on a dance-aerobics class filled with women, and opened fire with three guns, letting loose with a fusillade of at least 36 bullets.
He killed three women and wounded nine others before committing suicide.
"He just had a lot of hatred in him and (was) hell-bent on committing this act, and no one was going to stop him," Allegheny County Police Superintendent Charles Moffatt said Wednesday.
The 4,610-word Web diary appeared to be a nine-month chronology of his plans to end his misery with a shocking act of carnage at the health club. He portrayed himself as painfully and inexplicably lonely.
"Every evening I am alone, and then go to bed alone," he wrote. "I see twenty something couples everywhere. I see a twenty something guy with a nice twentyish young women. I think those years slipped right by for me. Why should I continue another 20+ years alone?"
It was unclear when the Web diary was posted and whether it had been updated online repeatedly since November or posted in its entirety recently. Moffatt said investigators are trying to determine whether anyone saw it online before the rampage.
"If anyone knew of it, they would have a moral and ethical obligation and legal obligation to bring it forward," the police superintendent said.
The violence rocked the town of about 5,300 people just outside Pittsburgh.
Killed were Heidi Overmier, 46, of Carnegie, a sales manager at an amusement park; Jody Billingsley, 37, of Mount Lebanon, who worked for a medical-supply company; and Elizabeth Gannon, 49, of Pittsburgh, an X-ray technician at Allegheny General Hospital.
"She can't be gone," said Gannon's next-door neighbor and close friend, Carl Rady, who knew her for 35 years and said she loved to work out and pamper her dog. "It can't happen that way."
Sodini was a member of the health club and had been there two times Tuesday before he came back at night, police said. He did not have a relationship with any of his victims, according to police.
In his Web diary, Sodini wrote of planning the attack since at least November and said he tried to carry it out when the same Tuesday-night aerobics class met on Jan. 6. "I cannot wait for tomorrow!" he exulted the night before. But he backed out at the last moment.
"It is 8:45PM: I chickened out!" he wrote. "I brought the loaded guns, everything. Hell!"
In his diary, he complained that women "don't even give me a second look ANYWHERE" even though he was tan and fit and claimed to dress well and smell nice. He listed his status as "Never married." In a chilling addition, he recorded the date of his death as Aug. 4, 2009.
On that evening, he walked into the health club wearing black workout gear and a headband, and entered the "Latin impact" class with four guns.
Jordan Solomon, 14, said she thought it was weird when a man walked into the all-female class and put a black duffel bag on the ground and reached into it.
"All of a sudden all the lights went out and I turned around, he started firing. I turned around and I saw him holding a gun," she said.
Solomon said the man was expressionless, and she didn't hear him say anything as he sprayed bullets. The teenager ran out of the room and into the parking lot, bolting into a restaurant where she told the workers to call 911.
Lauren Dooley, 27, who was exercising on a treadmill on the second floor, ran down the fire escape and out the rear of the building, where bystanders were applying pressure to victims' gunshot wounds.
"You just feel like you're in a movie ... a horrible movie where someone comes in and unleashes fire on everyone. You just don't know what to do," Dooley said.
She returned to the gym Wednesday morning to retrieve her purse and cell phone, but the doors were locked. A sign read: "Each of us in the LA Fitness family are shocked and saddened by the senseless acts of violence that took place at our Bridgeville club Tuesday evening."
Sodini did not have a criminal record, and he legally bought the guns he used, police said. Sodini used his cell phone a few minutes before the shooting, but Moffatt would not say whom he called.
Sodini's family issued a brief statement: "Our hearts and prayers are with the victims and their families and we pray for the full recovery of the survivors."
Six patients remained hospitalized, including the aerobics instructor, Mary Primis, 26, who was listed in fair condition. Primis is pregnant but said doctors told her the baby is fine.
Authorities initially had difficulty identifying the victims because they had workout clothes on and weren't carrying wallets.
Sodini graduated in 1992 from the University of Pittsburgh with a degree in computer science and had worked as a systems analyst at a Pittsburgh law firm since 1999.
A neighbor, Connie Fontanesi, said Sodini was so anti-social that "we really didn't learn anything personal about him."
Roberta Kozel, co-owner of Salon IAOMO, said Sodini was a regular at the tanning salon and last visited on Saturday. "He was just pretty normal, a little quiet - like the classroom nerd," Kozel said.
Associated Press writers Joe Mandak, Ramit Plushnick-Masti, Genaro Armas and Jennifer Yates contributed to this report.