In this paper, we introduce Hardy spaces with variable exponents defined on a probability space and develop the martingale theory of variable Hardy spaces. We prove the weak-type and strong-type inequalities on Doob’s maximal operator, and we get a (1,p(⋅),∞)-atomic decomposition for Hardy martingale spaces associated with conditional square functions. As applications, we obtain a dual theorem and the John–Nirenberg inequalities in the frame of variable exponents. The key ingredient is that we find a condition with a probabilistic characterization of p(⋅) to replace the so-called log-Hölder continuity condition in Rn.