We have shown that an alternative syntax for SMILES, which we call DeepSMILES, can address aspects of SMILES syntax that cause difficulties for machine-learning methods, particular in the context of generative models. The DeepSMILES syntax describes rings using a single symbol rather than a pair, thus avoiding the problem of unmatched ring closure symbols. The balanced pairs of parentheses required by valid SMILES syntax are replaced by multiple close parentheses that indicate the length of the preceding branch. Roundtripping tests from SMILES to DeepSMILES and back again show that the two notations convey exactly the same information.