The German man, who is known only as Dennis E. was detained on Wednesday by police in the southern province of Hatay and then charged later in the day, DHA news agency said.
He is accused of spreading terror propaganda on social media for the Kurdistan Workers' Party (PKK), which has been involved in armed conflict with the Turkish state since 1984.
The PKK is blacklisted as a terror group by Ankara and its Western allies.
In recent years there was a rise in diplomatic tensions between Ankara and Berlin over the crackdown that followed the July 2016 failed coup, during which several German nationals were also imprisoned.
But following the release of several German nationals including the German-Turkish journalist Deniz Yucel earlier this year, the strains have eased somewhat.
The Turkish government, meanwhile, ended the state of emergency, which had been in place since the coup, last week.
Germany subsequently lifted economic sanctions on Turkey and relaxed its travel advice to the country, removing a warning on its website about its nationals facing a high risk of arrest when visiting Turkey.