Piper cubeba L. is the berry of a shrub that is indigenous to Java, Southern Borneo, Sumatra, and other islands in the Indian Ocean. The plant is usually used in folk traditional medicine and is an important ingredient in cooking. The purpose of this study was to isolate and purify the bioactive compounds from P. cubeba L. fractions. In addition, the isolated compounds were tested for their antibacterial and antispore activities against vegetative cells and spores of Bacilluscereus ATCC33019, B. subtilis ATCC6633, B.pumilus ATCC14884, and B.megaterium ATCC14581. The phytochemical investigation of the DCM fraction yielded two known compounds: β-asarone (1), and asaronaldehyde (2) were successfully isolated and identified from the methanol extract and its fractions of P. cubeba L. Results showed that exposing the vegetative cells of Bacillus sp. to isolated compounds resulted in an inhibition zone with a large diameter ranging between 7.21 to 9.61 mm. The range of the minimum inhibitory concentration (MIC) was between 63.0 to 125.0 µg/mL and had minimum bactericidal concentration (MBC) at 250.0 to 500.0 µg/mL against Bacillus sp. Isolated compounds at a concentration of 0.05% inactivated more than 3-Log10 (90.99%) of the spores of Bacillus sp. after an incubation period of four hours, and all the spores were killed at a concentration of 0.1%. The structures were recognizably elucidated based on 1D and 2D-NMR analyses (1H, 13C, COSY, HSQC, and HMBC) and mass spectrometry data. Compounds 1, and 2 were isolated for the first time from this plant. In conclusion, the two compounds show a promising potential of antibacterial and sporicidal activities against Bacillus sp. and thus can be developed as an anti-Bacillus agent.