Lopez, singer of Love Don't Cost a Thing, submitted divorce papers in Los Angeles County Superior Court on Tuesday, TMZ said on Tuesday.
The filing came two years to the day after the pair held a lavish wedding celebration in Georgia.
They had initially exchanged vows in July 2022 at a Las Vegas wedding chapel.
Spokespeople for Lopez and Affleck did not immediately respond to requests for comment.
In the early 2000s, the pair dubbed "Bennifer" were the most talked about couple in the celebrity world in a relationship marked by his-and-her luxury cars and a large 6.1-carat pink diamond engagement ring.
They abruptly called off their wedding in 2003 and split up a few months later.
Lopez married Latin singer Marc Anthony, her third husband, just five months after her 2004 split with Affleck.
Affleck, director and star of Oscar-winning film Argo, went on to marry, and later divorce, actress Jennifer Garner.
Lopez and Affleck started dating again in 2021, months after she and baseball star Alex Rodriguez called off their engagement and ended a four-year relationship.
Lopez said later that the initial breakup with Affleck "was the biggest heartbreak of my life."
"I honestly felt like I was going to die," she said in an interview with Apple Music in November 2022.
"But now, 20 years later, it does have a happy ending."