We present the fourth-order compact finite difference (4cFD) discretizations for the long time dynamics of the nonlinear Klein-Gordon equation (NKGE), while the nonlinearity strength is characterized by p with a constant p ∈ N + and a dimensionless parameter ∈ (0, 1]. Based on analytical results of the lifespan of the solution, rigorous error bounds of the 4cFD methods are carried out up to the time at O(−p). We pay particular attention to how error bounds depend explicitly on the mesh size h and time step as well as the small parameter ∈ (0, 1], which indicate that, in order to obtain 'correct' numerical solutions up to the time at O(−p), the-scalability (or meshing strategy requirement) of the 4cFD methods should be taken as: h = O(p/4) and = O(p/2). It has better spatial resolution capacity than the classical second order central difference methods. By a rescaling in time, it is equivalent to an oscillatory NKGE whose solution propagates waves with wavelength at O(1) in space and O(p) in time. It is straightforward to get the error bounds of the oscillatory NKGE in the fixed time. Finally, numerical results are provided to confirm our theoretical analysis.