Miranda, a highly rated defender who made 23 league appearances for Barcelona B last season, featured on the bench four times for the senior team in 2018-19 and played three times in the Copa del Rey and once in the Champions League.
The 19-year-old is due to be in the Bundesliga until 2021, with Schalke making Miranda their 10th signing of the window.
"Juan is one of the most talented left-backs in Spanish football right now. As a youngster, he has been a regular in Spain's Under-19 side and has also played for Barcelona's first team," head coach David Wagner told Schalke's official website.
"It's amazing that we've signed him. We will give him the time to adjust to life here in Germany so that he can reach his full sporting potential here."
"I'm happy that the deal is now done. I hope that we can have a good season and I can play my part," said Miranda, who will wear the number three shirt for his new club.
Miranda's Barca contract expires in 2021 but is extendable by two more years, with a €200million release clause included.
Schalke, who lost 3-0 to Bayern Munich last week, host Hertha Berlin on Saturday looking for their first win of the season.