The packing factor is an important parameter for describing the internal structural features in pebble beds, which have a significant influence on the heat and mass transfer behavior and the thermo-mechanical properties of the pebble bed. A comprehensive understanding of the packing structure is essential for the design and optimization of the pebble bed and can promote the application of the pebble bed. In this work, an improved line-based averaging method was proposed to calculate the local packing factor or local porosity distribution and validated by comparing the results with those obtained from experimental and numerical studies of cylindrical packed pebble bed. Furthermore, the local packing factor distributions in the angular-radial plane of the cylindrical pebble bed were revealed for the first time. In addition, the line-based averaging method has been applied to reveal the local packing factor distributions in the annular pebble beds, U-shaped pebble beds and hexagonal pebble beds. The main feature of this method is the ability to calculate and plot contour maps of local packing factor or porosity distributions for columnar pebble beds of arbitrary shapes, especially the local packing factor distributions in the cross-sectional plane and the angular-radial plane.