In a radio-frequency identification (RFID) system, the dynamic frame length ALOHA protocol is widely adopted to solve the anticollision problem. Analysis for the anticollision problem can be divided into two primary parts. The concern of the first part is how to precisely estimate the number of tags. The other part involves determination of dynamic frame length to achieve maximum throughput or channel usage efficiency. In this paper, we present an accurate method for estimating tag quantity. This method is based on the maximum aposteriori probability decision. We also derive the optimal frame length using radio channel efficiency. Simulation results indicate the tag estimate error of the proposed method is less than 4%. Use of our proposed tag estimate method together with optimal frame length can achieve close to the theoretical maximum throughput of the framed ALOHA algorithm.