Soil provides ecosystem services, supports human health and habitation, stores carbon and regulates emissions of greenhouse gases. Unprecedented pressures on soil from degradation and urbanization are threatening agro-ecological balances and food security. It is important that we learn more about soil to sustainably manage and preserve it for future generations. To this end, we developed and analyzed a global soil visible-near infrared (vis-NIR) spectral library. It is currently the largest and most diverse database of its kind. We show that the information encoded in the spectra can describe soil composition and be associated to land cover and its global geographic distribution, which acts as a surrogate for global climate variability. We also show the usefulness of the global spectra for predicting soil attributes such as soil organic and inorganic carbon, clay, silt, sand and iron contents, cation exchange capacity, and pH. Using wavelets to treat the spectra, which were recorded in different laboratories using different spectrometers and methods, helped to improve the spectroscopic modelling. We found that modelling a diverse set of spectra with a machine learning algorithm can find the local relationships in the data to produce accurate predictions of soil properties. The spectroscopic models that we derived are parsimonious and robust, and using them we derived a harmonized global soil attribute dataset, which might serve to facilitate research on soil at the global scale. This spectroscopic approach should help to deal with the shortage of data on soil to better understand it and to meet the growing demand for information to assess and monitor soil at scales ranging from regional to global. New contributions to the library are encouraged so that this work and our collaboration might progress to develop a dynamic and easily updatable database with better global coverage. We hope that this work will reinvigorate our community's discussion towards larger, more coordinated collaborations. We also hope that use of the database will deepen our understanding of soil so that we might sustainably manage it and extend the research outcomes of the soil, earth and environmental sciences towards applications that we have not yet dreamed of.