Polyaniline (PANI) and its graphene-doped composite (PANI-GNP) were subjected to open-aperture (OA) z-scan studies to investigate their nonlinear optical (NLO) properties and optical limiting (OL) behavior. The z-scan experiments were carried out using a nanosecond pulsed Nd:YAG laser at a wavelength of 532 nm. The z-scan studies revealed that PANI and PANI-GNP composites exhibited a reverse saturable absorption (RSA), and graphene doping modified the NLO behaviour and improved the OL property. The nonlinear absorption coefficient (β), OL threshold, and imaginary part of nonlinear susceptibility (
χ
i
(
3
)
) of PANI and PANI-GNP were calculated for three different laser input pulse energies and found to be in the order of 10−9 cm W−1, 106 W cm−2, and 10−10 esu, respectively. These results qualify the PANI-GNP composite as having potential applications in OL and optoelectronic devices. The successful incorporation of graphene into PANI in PANI-GNP composite was confirmed by scanning electron microscopy (SEM), transmission electron microscopy (TEM) and Fourier transform infrared spectroscopy (FTIR). Linear optical properties were analysed using UV–visible absorption spectroscopy. To the best of our knowledge, the present work is the first attempt to explore the intensity-dependent NLO properties, OL behaviour and the calculation of their related NLO parameters of PANI-GNP composites.