MGridGen is a parallel library written entirely in ANSI C that implements (serial) algorithms for obtaining a sequence of successive coarse grids that are well-suited for geometric multigrid methods. The quality of the elements of the coarse grids is optimized using a multilevel framework. It is portable on most Unix systems that have an ANSI C compiler. An MPI-based parallel version of MGridGen, called ParMGridGen, has also been developed that extends the functionality provided by MGridGen and is especially suited for large scale numerical simulations. It is written entirely in ANSI C and MPI and is portable on most parallel computers that support MPI.