We give an upper bound on the number of perfect matchings in simple graphs with a given number of vertices and edges. We apply this result to give an upper bound on the number of 2-factors in a directed complete bipartite balanced graph on vertices. The upper bound is sharp for even . For odd we state a conjecture on a sharp upper bound.