The US Geological Survey said the earthquake occurred at 16:47 pm GMT, which shook Cipatujah district, West Java province.
Its epicentre was at 91.86km deep. There have been no report on damage and casualties in the quake.
Indonesia is prone to quake as it lies on a vulnerable quake-hit zone called "the Pacific Ring of Fire."
An earthquake struck the country's western Aceh province in December 2016, killing more than 100 people and leaving tens of thousands homeless. A 9.2-magnitude quake along with tsunami jolted the province in 2004, claiming more than 120,000 lives.- VNS