When Paige Anderson was 20 years old, she made a pact with her best friend, Grant Lowe: If the two remained single by age 30, they would get married.

On June 8, 2014, the day after graduating from Knox College in Galesburg, Ill., Ms. Anderson (now Ms. Lowe) and Mr. Lowe wed. At 22, eight years before the deadline, their wedding was held on campus at Alumni Hall among friends, family and faculty.

Their initial informal promise was a safe way to flirt, because the two were afraid to reveal their mutual feelings. “You can back out of it if no one believes it; you can tell yourself it was just a joke,” said Ms. Lowe, noting that her husband once agreed to a similar arrangement with a friend from high school. (Mr. Lowe has no previous marriages.)

The verbal contract between Mr. and Ms. Lowe was a conversation opener to their progression beyond friendship. But, often, small-talk marriage pacts are not binding. They are guided by the fear of being alone, according to Lynn Saladino, a clinical psychologist in Manhattan who focuses on relationships.