Six different men won internet auctions to have sex with the woman in April and May last year. They were only known to her by their online names, a spokesman for a court in the southwestern city of Stuttgart said on Wednesday.
"The woman wanted to discover which one of the men had made her pregnant," the spokesman said. "So she needed their contact details. Of course, if they're not willing to go along with the gene test, she'll have to take them to court."
The woman asked the site's operator to reveal the true identity of the men, but it refused, citing a confidentiality clause in its terms and conditions.
The court ruled in her favour, saying the child's right to know who its father was took precedence.
The court declined to give the woman's age and nationality.