When an infectious disease occurs in an area, early detection of infected farms is important to respond quickly and contain the outbreak on a small scale. Estimating the time window for the introduction of the infection is important for its prevention and control. The aim of this study was to estimate the farm-specific time window from the introduction of the highly pathogenic avian influenza (HPAI) virus into poultry farms using field data from the HPAI H5N8 outbreak in the 2020-2021 winter season in Japan. Daily mortality data from 12 broiler chicken farms during the outbreak were used for the analysis. A mathematical model (Susceptible-Exposed-Infectious-Removed, SEIR model) was applied to generate the within-flock transmission of HPAI. The model-predicted mortality was fitted to the observed excess mortality data induced by HPAI to estimate the farm-specific transmission rate and the time of virus introduction. The estimated value of the transmission rate in each farm was 1.449 day-1 in median (min: 0.661 day-1, max: 3.387 day-1). The time window from the introduction of the virus to notification in each farm was estimated at 14.0 days in median (min: 8.6 days, max: 24.1 days) in the deterministic model. In addition, in the stochastic model considering the randomness of transmission in the early phase of the outbreak, the upper value of 95 % credible interval of the time window ranged from 12 to 34 days, with a median of 21 days. The results suggest that although one to three weeks had elapsed on most farms until notification after the virus introduction, the time window could exceed three weeks considering the stochasticity of disease transmission. As for the potential farm characteristics affecting within-flock transmission, the transmission rate was smaller (p-value=0.02) and the estimated time window from introduction to notification was longer (p-value=0.02) when birds were older. This study provides reliable information for setting up a tracing period for a potential source farm and enhancing the efforts for early detection.