The application of graphene oxide (GO)-based membranes combined with a quartz crystal microbalance (QCM) as a humidity sensor has attracted great interest over the past few years. Understanding the influence of the structure of the GO membrane (GOM) on the adsorption/desorption of water molecules and the transport mechanism of water molecules in the membrane is crucial for development of applications using GOM-based humidity sensors. In this paper, by investigating the effects of oxygen-containing groups, flake size and interlayer spacing on the performance of humidity sensing, it was found that humidity-sensing performance could be improved by rational membrane-structure design and the introduction of magnesium ions, which can expand the interlayer spacing. Therefore, a novel HGO&GO&Mg2+ structure prepared by uniformly doping magnesium ions into GO&HGO thin composite membranes was designed for humidity sensing from 11.3% RH to 97.3% RH. The corresponding sensor exhibits a greatly improved humidity sensitivity (~34.3 Hz/%RH) compared with the original pure GO-based QCM sensor (~4.0 Hz/%RH). In addition, the sensor exhibits rapid response/recovery times (7 s/6 s), low hysteresis (~3.2%), excellent repeatability and good stability. This research is conducive to understanding the mechanism of GOM-based humidity sensors. Owing to its good humidity-sensing properties, the HGO&GO&Mg2+ membrane-based QCM humidity sensor is a good candidate for humidity sensing.