We use entanglement entropy to define a central charge associated to a two-dimensional defect or boundary in a conformal field theory (CFT). We present holographic calculations of this central charge for several maximally supersymmetric CFTs dual to eleven-dimensional supergravity in Anti-de Sitter space, namely the M5-brane theory with a Wilson surface defect and three-dimensional CFTs related to the M2-brane theory with a boundary. Our results for the central charge depend on a partition of the number of M2-branes, $N$, ending on the number of M5-branes, $M$. For the Wilson surface, the partition specifies a representation of the gauge algebra, and we write our result for the central charge in a compact form in terms of the algebras Weyl vector and the representations highest weight vector. We explore how the central charge scales with $N$ and $M$ for some examples of partitions. In general the central charge does not scale as $M^3$ or $N^{3/2}$, the number of degrees of freedom of the M5- or M2-brane theory at large $M$ or $N$, respectively.