Green betel leaves (Piper betle L.) essential oil (PBEO) exhibits antibacterial activity; however, volatility limits its stability and effectiveness. Chitosan, as a biopolymer-based drug delivery system, can enhance the stability and controlled release of essential oils. This study was aimed to optimize the concentration of PBEO when encapsulated with chitosan (PEC) to achieve antibacterial activity against two common mastitis-associated bacteria in dairy goats, Staphylococcus epidermidis and Klebsiella pneumoniae. The PBEO was extracted through steam distillation, followed by an ionic-gelation process to encapsulate it using chitosan with varying PBEO concentrations (PEC 7.5%, 15%, and 30%). Antibacterial activity was first assessed in vitro using disc diffusion method, with amoxicillin and distilled water as positive and negative controls, respectively. In vivo assay was conducted on eight lactating Jamnapari or Ettawa crossbred goats that confirmed positive mastitis, which were then randomly divided into five groups treated by post-milking dipping with three PEC concentration, 70% ethanol (positive control), and distilled water (negative control) for 35 days, and bacterial count was determined using total plate count (TPC) assay every seven days. Concentrations 7.5%, 15% and 30% of PEC produced inhibition zones against S. epidermidis (15.0, 17.5 and 18.5 mm, respectively) and K. pneumoniae (12.0, 14.0 and 14.0 mm, respectively). Moreover, TPC revealed that PEC 15% (R=-1, P<0.01) and 30% (R=-0.94, P<0.05) reduced the total number of milk bacteria (P<0.05). Collectively, PEC at 15% and 30% demonstrated in vitro antibacterial activity and were associated with reduced milk bacterial counts in goats.