Hydrogel beads were fabricated by encapsulating Mg(OH)2 inside them. A quantitative fluorescence method was developed to map pH inside the beads. The pH inside buffer-load beads was around neutral after stomach digestion. The pH inside buffer-free beads changed to acid value after stomach digestion.