The 32-year-old was a free agent after leaving Chelsea, having spent seven years at Stamford Bridge.
Willian had rejected the offer of a two-year extension with the Blues, paving the way for him to join their London rivals.
Arsenal head coach Mikel Arteta admitted he was impressed by Willian's desire to join the Gunners.
"I believe he's a player that can really make a difference for us," said Arteta.
"We have been monitoring him for the past few months, we had a clear intention to strengthen in the attacking midfielder and the winger positions; he is a player that gives us a lot of versatility, he can play in three or four different positions.
"He has the experience of everything in the football world but to still have the ambition to come here and contribute to bring the club where it belongs. I have been really impressed with all the talks I have had with him and how much he wanted to come."
Chelsea boss Frank Lampard had been clear all season that he wanted to keep Willian at Stamford Bridge.
But the former England midfielder recently admitted the Blues would have to accept Willian's decision, even if that meant him playing for one of their main rivals next season.
Willian helped Chelsea to two Premier League titles, one FA Cup triumph and the 2019 Europa League, where the Blues thumped Arsenal 4-1 in Baku.
The ex-Corinthians player was forced to watch on when Arsenal beat Chelsea 2-1 in this year's FA Cup final however, missing out through a troublesome ankle problem.
Willian will wear the number 12 shirt at Arsenal.
"I know him very well, since a long time ago because we've been working together for the Brazilian national team and of course I was following him because he played for another club," said Arsenal's technical director Edu.
"He has a lot of fantastic attributes as a person, as a football player of course, his character. I'm 100 per cent sure that everybody in the dressing room, the fans, myself and Mikel will enjoy having Willian in our side."