We report on two types of poly(methacrylic acid) (PMAA)-based hydrogel microcontainers (capsules) of cubical shape with distinctly different shape responses upon pH variations. The microcontainers were prepared as replicas of cubical inorganic templates through chemical cross-linking of hydrogen-bonded layer-by-layer (LbL) films. The two types of hollow hydrogels, a single-component (PMAA) and PMAA-poly(N-vinylpyrrolidone) (PMAA-PVPON), showed drastic differences in their shape response to pH variations. Cubical (PMAA)20 capsules turned into bulged sphere-like structures of the same size when transitioned from pH 3 to pH 8. In contrast, cubical (PMAA-PVPON)5 capsules retained their cubical shape at pH 3 while increasing in size at pH 8. The pH-triggered size change of cubical capsules was completely reversible. The difference in pH-triggered shape responses was rationalized through the difference in hydrogel rigidity expressed as the ratio of the polymer contour length between the neighboring cross-links to the persistence polymer length. The ratios of 22.7 and 2 for (PMAA) and (PMAA-PVPON) systems, respectively, suggested that the dual-component system is more rigid and therefore expands uniformly in all directions. We believe that the results provide new prospects for developing polymeric materials with predictable shape and size-changing properties for controlled drug delivery, cellular uptake, and pH-regulating transport behavior in microfluidic devices. © 2012 The Royal Society of Chemistry.