The use of X-ray and neutron reflectivity has been generalized worldwide for scientists who want to determine specific physical properties (such as electrondensity profile, scattering-length density, roughness and thickness) of films less than 200 nm thick deposited on a substrate. This paper describes a freeware program named REFLEX, which is a standalone program dedicated to the simulation and analysis of X-ray and neutron reflectivity from multilayers. This program was first written two decades ago and has been constantly improved since, but never published until now. The latest version of REFLEX covers generalized types of calculation of reflectivity curves including both neutron and X-ray reflectivity. In the case of X-rays, the program can deal with both s and p polarization, which is quite important in the soft X-ray region where the two polarizations can yield different results. Neutron reflectivity is calculated within the framework of non-spin-polarized neutrons. REFLEX has also been designed to include any type of fluid (such as supercritical CO 2 ) on top of the analysed film and includes corrections of the footprint effect for analysis on an absolute scale. computer programs J. Appl. Cryst. (2019). 52, 201-213 Vignaud and Gibaud REFLEX 203Figure 1Illustration of the plane of incidence for a stratified medium. The signs + and À indicate the direction of propagation of the wave.