In this work, a detailed study of the structural, electronic and absorption properties of crystalline 1-ethyl-1,4-dihydro-7-methyl-4-oxo-1,8-naphthyridine-3-carboxylic acid (nalidixic acid) in the pressure range 0–300GPa is performed by density functional theory (DFT) calculations. The detail analysis of the variation tendencies of the lattice constants, bond lengths and bond angles with increasing pressures shows that complex transformations occur in nalidixic acid under compression. In addition, it can be see that the a- and c-axes are much stiffer than the b-direction in the structure of nalidixic acid, suggesting the crystal is anisotropic. In the pressure range 90–250GPa, repeated formations and disconnections of covalent bonds between C6 (P1 or P4) and O1 (P4 or P1) occur several times, and a new eight-atom ring forms at 90, 160, 190 and 230GPa, respectively. Then, the analysis of the bandgap and density of states (DOS) of nalidixic acid indicates that its electronic character changes at 230GPa into an excellent insulator, but the electron transition is much easier at several pressure regions for the bandgap closing to 0eV. Moreover, as the pressure increases relatively high optical activity of nalidixic acid is seen from the absorption spectra, and two obvious structural transformations are also observed at 200 and 230GPa, respectively.