Context : The knowledge of the initial mass function ( IMF ) in open clusters constitutes one way of constraining the formation of low-mass stars and brown dwarfs , along with the frequency of multiple systems and the properties of disks . Aims : The aim of the project is to determine the shape of the mass function in the low-mass and substellar regimes in the \sigma Orionis cluster ( \sim 3 Myr , \sim 352 pc , solar metallicity ) as accurately as possible and compare it with the results in other clusters . Methods : We have analysed the near-infrared photometric data from the Fourth Data Release ( DR4 ) of the UKIRT Infrared Deep Sky Suvey ( UKIDSS ) Galactic Clusters Survey ( GCS ) to derive the cluster luminosity and mass functions , evaluate the extent of the cluster , and study the distribution and variability of low-mass stars and brown dwarfs down to the deuterium-burning limit . Results : We have recovered most of the previously published members and found a total of 287 candidate members within the central 30 arcmin in the 0.5–0.009 M _ { \odot } mass range , including new objects not previously reported in the literature . This new catalogue represents a homogeneous dataset of brown dwarf member candidates over the central 30 arcmin of the cluster . The expected photometric contamination by field objects with similar magnitudes and colours to \sigma Orionis members is \sim 15 % . We present evidence of variability at the 99.5 % confidence level over \sim yearly timescales in 10 member candidates that exhibit signs of youth and the presence of disks . The level of variability is low ( \leq 0.3 mag ) and does not impact the derivation of the cluster luminosity and mass functions . Furthermore , we find a possible dearth of brown dwarfs within the central five arcmin of the cluster , which is not caused by a lower level of photometric sensitivity around the massive , O-type multiple star \sigma Ori in the GCS survey . Using state-of-the-art theoretical models , we derived the luminosity and mass functions within the central 30 arcmin from the cluster centre , with completeness down to J = 19 mag , corresponding to masses ranging from 0.5 M _ { \odot } down to the deuterium-burning mass boundary ( \sim 0.013 M _ { \odot } ) . Conclusions : The mass function of \sigma Orionis in this mass interval shows a power law index \alpha = 0.5 \pm 0.2 ( when expressed as dN/dM \propto M ^ { - \alpha } ) , which agrees with the one derived for the 3–5 Myr cluster Upper Sco ( based on similar data obtained with the GCS ) in the same mass range .