The 24-year-old struggled to establish himself at Camp Nou after coming through the ranks to make his first-team debut in the Copa del Rey in October 2009.
Dos Santos made 28 first-team appearances for the club he joined 12 years ago as a youngster, but injuries limited him to only three last season.
La Liga's 2013/14 runners-up wished him well for the future and thanked Dos Santos for the efforts he had shown when called upon.
"FC Barcelona wishes to publicly thank the professionalism and dedication of Jonathan dos Santos this season, and wishes him the best for the future," they said on their official website.
Having put a frustrating campaign behind him the Mexico international will now line up alongside his brother Giovani at El Madrigal.
Villarreal welcomed the midfielder via their official Twitter account and announced he would be presented on Thursday after completing his medical.
Barca revealed the deal could reach €2 million and the Catalan giants will also receive a cut of any future sale.
Get the best features, fun and footballing frolics straight to your inbox every week.
Thank you for signing up to Four Four Two. You will receive a verification email shortly.
There was a problem. Please refresh the page and try again.