We consider copulas with a given diagonal section and compute the explicit density of the unique optimal copula which maximizes the entropy. The entropy can also be written as the relative entropy with respect to the independent copula. In this sense, this copula is the least informative one among the copulas with a given diagonal section. We give an explicit criterion on the diagonal section for the existence of the optimal copula and give a closed formula for its relative entropy. We also provide examples for some diagonal sections of usual bivariate copulas and illustrate the differences between them and the maximum entropy copula with the same diagonal section. An interesting application of the results concerning copulas of order statistics will also be presented.