Fluorescent indicators for the intracellular determination of Ca2+ and Mg2+ have been studied by means of theoretical calculations, based on Density Functional Theory (DFT). The indicators consist of the pedant o-aminophenol-N,N O-triacetic acid (APTRA), linked to an arylthiophene fluorophore substituted in the para position with donor or acceptor groups. The interaction of Ca2+ and Mg2+ with the indicators was studied both in the gas phase and in solvent. In the gas phase, these cations both have a five-fold coordination. Binding with the cation results in a change in the hybridisation state of the nitrogen from sp(2) to sp(3); the nitrogen lone pair is no longer part of the conjugated system. The metal-nitrogen interaction is given up in solvent; the structure relaxes so that the nitrogen lone pair can again participate in the conjugated system of the fluorophore. The effect of the electron-withdrawing or -donating substituents on the cation-indicator interaction was investigated. Two effects determine the nature of the complexation in solvent. Firstly, there is the inherent binding energy of the indicator with the metal, which is favored by electron-donating substituents and weakened by electron-withdrawing groups. Secondly, there is a stabilising effect of the solvent on the free indicators; due to their smaller dipole moment, fi ee indicators with electron-withdrawing groups are stabilised less by the solvent. For various substituents, these two effects evolve in opposite ways. This results in a small overall variation of complexation energies.