We study the flavor structure in SO(32) heterotic string theory on six-dimensional tori with magnetic fluxes. Specifically, we focus on models with the flavor symmetries SU(3)(f) and Delta(27). In both models, we can realize the realistic quark masses and mixing angles.