  Next-generation dark matter direct detection experiments will explore several
orders of magnitude in the dark matter--nucleus scattering cross section below
current upper limits. In case a signal is discovered the immediate task will be
to determine the dark matter mass and to study the underlying interactions. We
develop a framework to determine the dark matter mass from signals in two
experiments with different targets, independent of astrophysics. Our method
relies on a distribution-free, nonparametric two-sample hypothesis test in
velocity space, which neither requires binning of the data, nor any fitting of
parametrisations of the velocity distribution. We apply our method to realistic
configurations of xenon and argon detectors such as XENONnT/DARWIN and
DarkSide, and estimate the precision with which the DM mass can be determined.
Once the dark matter mass is identified, the ratio of coupling strengths to
neutrons and protons can be constrained by using the same data. The test can be
applied for event samples of order 20 events, but promising sensitivities
require $\gtrsim 100$ events.
