The defending county champions have had an underwhelming red-ball season, drawing five of their first eight games to find themselves sixth in the Championship, and while they are top of the North Group in the T20 Blast, they are looking to strengthen over the winter.
Barnard is Worcestershire's leading red-ball run-scorer this season and is on course for his best-ever Championship season, leading Paul Farbrace, Warwickshire's director of cricket, to describe him as "a huge signing for the club".
"We believe Ed will bring an extra dimension to our team and he is someone that we have always been impressed by and admired over recent years," Farbrace said. "The coaches are incredibly excited to help aid his development and with the potential he possesses, Ed can reach the higher echelons of the game."
Barnard said: "I'm extremely excited to join Warwickshire and I feel it's a really big opportunity for me. My ambition is to play at the highest level and I am determined to win trophies with the Bears, play franchise cricket and be selected for England.
"I will be forever thankful to everyone involved with Worcestershire from back in my academy time to the present day. I've been very fortunate to have had the opportunities to represent this terrific club and develop into the cricketer I am today."
Worcestershire described Barnard's departure after his 15-year association with the club as "very disappointing" and confirmed in a statement that they had offered him a new contract which he had turned down.
"It's obviously disappointing for our club, but we wish Ed well for the future," Alex Gidman, their head coach, said. "He has made significant progress in the last few years at Worcestershire and has become an integral part of our team in all formats.
"Ed wants to finish the season very well with us, and we look forward to enjoying our last few months with him before he moves on."