The foreigners were from Brazil, the Netherlands, Vietnam, Malawi and Nigeria. All the convicts were executed by firing squad shortly after midnight.
"The execution of the six convicts has been carried out," spokesman Tony Spontana told AFP.
He said five were executed on Nusakambangan Island, off the south coast of the archipelago's main island of Java and home to a high-security prison.
The sixth was executed in Boyolali district in central Java.
They were the first executions to be carried out under the new government of President Joko Widodo, who took office in October.