Video circulating on social media showed a fighter plane performing manoeuvres in the skies above Yogyakarta before spiralling toward the ground at speed and disappearing from view.
Seconds later a thick, dark plume of smoke rose beyond the horizon, as people in the video can be heard screaming.
Indonesian air force spokesman Dwi Badarmanto confirmed a T-50 Golden Eagle fighter plane had crashed during a demonstration.
“Two pilots died,” he told news website Detik.
It remains unclear if anyone on the ground was killed or injured.
A major military air show had been underway this weekend in Yogyakarta.
In June, a Hercules C-130 crashed into a residential neighbourhood in Medan, the largest city on Sumatra island, killing 142 people and causing widespread destruction.