Abstract We develop a new nonparametric method to reconstruct the equation of state (EoS) of a neutron star with multimessenger data. As a universal function approximator, the feed-forward neural network (FFNN) with one hidden layer and a sigmoidal activation function can approximately fit any continuous function. Thus, we are able to implement the nonparametric FFNN representation of the EoSs. This new representation is validated by its capability of fitting the theoretical EoSs and recovering the injected parameters. Then, we adopt this nonparametric method to analyze the real data, including the mass–tidal deformability measurement from the binary neutron star merger gravitational-wave event GW170817 and mass–radius measurement of PSR J0030+0451 by NICER. We take the publicly available samples to construct the likelihood and use the nested sampling to obtain the posteriors of the parameters of the FFNN according to the Bayesian theorem, which in turn can be translated to the posteriors of the EoS parameters. Combining all of these data for a canonical 1.4 M ⊙ neutron star, we get a radius R 1.4 = 11.83 − 1.08 + 1.25 km and tidal deformability Λ 1.4 = 323 − 165 + 334 (90% confidence interval). Furthermore, we find that in the high-density region (≥3ρ sat), the 90% lower limits of c s 2 / c 2 (where c s is the sound speed and c is the velocity of light in vacuum) are above 1/3, which means that the so-called conformal limit (i.e., c s 2 / c 2 < 1 / 3 ) is not always valid in the neutron stars.