Networks-on-Chip is a new paradigm to make the interconnections inside a System-on-Chip system, and the traffic in NoC is the most important issue that impacts the pereformance. Therefore congestion detection has become a hot issue in NoC. Congestion aware routing algorithms are created to aware and avoid the congestion area, lower the transmission latency and increase the throughput of the network. In this paper, a history-based congestion prediction algorithm named HCP is proposed, where broadcasted packets are used to carry the congestion information and the information is used to estimate the congestion condition inside the network. Besides the congestion, HCP also considers the historical routed packets and the path diversity to predict the congestion and balance the traffic in the network. Compared with conventional congestion aware routing algorithms, the proposed algorithm shows better results in both latency and throughput.