The study aims to find the optimal fin length distribution for improved heat transfer during melting and solidification in a tubular PCM heat exchanger designed for heat storage. Three types of horizontal PCM tabular heat exchangers, all with five longitudinal fins, were studied numerically. While maintaining a constant heat transfer area, each model depicts a unique fin length distribution design. The first model, which serves as the reference design, has a homogeneous fin length distribution and each fin is 30 mm long. The second model has shorter upper and side fins and longer lower fins (20 mm for the upper fin, 25 mm for the side fins, and 40 mm for the lower fins). The third model has long lower fins but shorter than that of second model, short side fins and no change in upper fin length with reference design (30 mm for upper fin, 25 mm for side fins and 35 mm for lower fins). The findings indicate that the second model exhibits the best heat transfer performance for the melting process, while the first model is most effective for solidification. Interestingly, the third design emerges as the optimum choice for both melting and solidification processes.