Context. Detailed studies of magnetic cloud observations in the solar wind in recent years indicate that magnetic clouds are interplanetary flux ropes with a low twist. Commonly, their magnetic fields are fit by the axially symmetric linear force-free field in a cylinder (Lundquist field), which in contrast has a strong and increasing twist toward the boundary of the flux rope. Therefore another field, the axially symmetric uniform-twist force-free field in a cylinder (Gold-Hoyle field) has become employed to analyze magnetic clouds.Aims. Magnetic clouds are bent, and for some observations, a toroidal rather than a cylindrical flux rope is needed for a local approximation of the cloud fields. We therefore try to derive an axially symmetric uniform-twist force-free field in a toroid, either exactly, or approximately, and to compare it with observations.Methods. Equations following from the conditions of solenoidality and force-freeness in toroidally curved cylindrical coordinates were solved analytically. The magnetic field and velocity observations of a magnetic cloud were compared with solutions obtained using a nonlinear least-squares method.Results. Three solutions of (nearly) uniform-twist magnetic fields in a toroid were obtained. All are exactly solenoidal, and in the limit of high aspect ratios, they tend to the Gold-Hoyle field. The first solution has an exactly uniform twist, the other two solutions have a nearly uniform twist and approximate force-free fields. The analysis of a magnetic cloud observation showed that these fields may fit the observed field equally well as the already known approximately linear force-free (Miller-Turner) field, but it also revealed that the geometric parameters of the toroid might not be reliably determined from fits, when (nearly) uniform-twist model fields are used. Sets of parameters largely differing in the size of the toroid and its aspect ratio yield fits of a comparable quality.