This paper proposes a new backoff algorithm called the Estimation-based Backoff Algorithm (EBA) to enhance the performance of the Distributed Coordination Function (DCF) in IEEE 802.11 wireless networks. The EBA observes the number of idle slots during the backoff period to estimate the number of active nodes. It then determines a more appropriate contention window size based on this estimation. Simulation results show that the EBA outperforms other backoff algorithms by increasing throughput by around 25% and decreasing mean packet delay by about 50% compared to the binary exponential backoff algorithm when there are 70 nodes.