Machine learning algorithms based on artificial neural networks have proven very useful for a variety of classification problems. Here we apply them to a well-known problem in crystallography, namely the classification of x-ray diffraction (XRD) patterns of inorganic powder specimens by the respective crystal system and space group. Over 105 theoretically computed powder XRD patterns were obtained from inorganic crystal structure databases and used to train a deep dense neural network. For space group classification, we obtain an accuracy of around 54% on experimental data. Finally, we introduce a scheme where the network has the option to refuse the classification of XRD patterns that would be classified with a large uncertainty. This enhances the accuracy on experimental data to 82% at the expense of having half of the experimental data unclassified. With further improvements of neural network architecture and experimental data availability, machine learning constitutes a promising complement to classical structure determination methodology.