Dental infections are initiated by Streptococcus sanguinis and Streptococcus mutans through the biofilm formation. In streptococcal, the ComA enzyme catalyzes the first step to produce signalling molecules in quorum sensing that influence biofilm formation. Ocimum basilicum is one of the natural sources which is potential for antibacterial agent. This study is aimed to isolate phenolic compounds from O. basilicum leaves with antibacterial activity against oral pathogens by experimental and computational screening studies. Isolation of phenolic compounds 1–4 was carried out by bioactivity guided using column chromatography. Methylparaben (1), methyl protocatechuate (2), caffeic acid (3), and methyl caffeate (4) were characterized by 1D and 2D‐NMR. The antibacterial activity was tested by disk diffusion, microdilution methods. 1 (625 μg·mL−1) provided moderate activity, and 2 (156.3 μg·mL−1) provided strong activity against S. mutans. 3 (125 μg·mL−1) and 4 (312.5 μg·mL−1) provided strong activity against S. sanguinis. In addition, phenolic compounds and their derivatives were predicted against ComA using Autodock 4.0 tools. The activity correlated positively with in silico tests against ComA where 2 (−7.69 kcal·mol−1) had a stronger binding affinity than 1 (−6.64 kcal·mol−1). 3 (−6.86 kcal·mol−1) provided a slightly stronger bond strength than 4 (−6.65 kcal·mol−1). The strongest binding affinity of hydroxybenzoic acid derivatives is 3,5‐dihydroxybenzoic acid (−8.10 kcal·mol−1). In addition, the strongest binding affinity of hydroxycinnamic acid derivatives is chlorogenic acid (−9.16 kcal·mol−1). The pharmacokinetics were predicted by ADMET analysis, and methyl caffeate (4) showed the best potential as a drug compound. The conclusion is that phenolic compounds isolated from O. basilicum have potential as natural antibacterials. In silico tests also showed the relationship between the structure and activity by the presence of the hydroxyl group in hydroxybenzoic acid derivatives and the presence of an alkyl group in the unsaturated side chain in hydroxycinnamic acid derivatives.