Theory and methods to obtain reduced order models by moment matching from input/output data are presented. Algorithms for the estimation of the moments of linear and nonlinear systems are proposed. The estimates are exploited to construct families of reduced order models. These models asymptotically match the moments of the unknown system to be reduced. Conditions to enforce additional properties, e.g. matching with prescribed eigenvalues, upon the reduced order model are provided and discussed. The computational complexity of the algorithms is analyzed and their use is illustrated by two examples: we compute converging reduced order models for a linear system describing the model of a building and we provide, exploiting an approximation of the moment, a nonlinear planar reduced order model for a nonlinear DC-to-DC converter. 2017 The Author(s). Published by Elsevier Ltd.