The structure of dioctahedral 2:1 phyllosilicates with different interlayer charge was studied theoretically using ab initio calculations. The standard Kohn-Sham self-consistent density functional method was used in the generalized gradient approximation (GGA), with numerical atomic orbitals as the basis set, by means of the SIESTA program. Once the method had been checked satisfactorily, the theoretical study was extended beyond the systems for which there are experimental information, and structural characteristics were predicted. The SIESTA program was shown to be a useful tool in studying the crystallographic properties of 2:1-dioctahedral phyllosilicates. The crystal structures of pyrophyllite, beidellite, and other smectites and illites were simulated. The experimental crystallographic properties of phyllosilicates with high, medium, and low interlayer charge were reproduced. The calculated structures agree with the main experimental structural features of the crystal lattice of these minerals. The effect of cation substitutions in the octahedral and tetrahedral sheets was also studied. The calculated effects are consistent with experimental results. The Mg2+ cations were found to have a tendency to be distributed in the octahedral sheet, in contrast to Fe3+ ions that tend to be clustered.