The Portuguese succeeds Paul Clement, who was recently relieved of his duties due to poor results.
Midfielder Leon Britton has been in caretaker charge since Clement's sacking, but it is unclear if he will be part of Carvalhal's backroom staff.
Carvalhal joins the club on a deal that runs until the end of the season, with an option of an extension.
The 52-year-old was sacked as Sheffield Wednesday manager on Christmas Eve after losing 2-1 to Middlesbrough the previous day, but has quickly found a way back into management.
Speaking to Swansea's club website, Carvalhal insisted that Swansea can still avoid relegation, despite currently propping up the Premier League.
"In this moment, maybe if you ask 100 people who follow football, they will say Swansea are going to get relegated," he admitted.
"Maybe some people will say we need a miracle. But when things are in the hands of men, it's not a miracle you need. We don't need divine help.
"We need strong commitment to move things forward. I promise we will try very hard to change things around.
"It will be a difficult challenge. We know the position we are in at the moment, but we can do it."
Swansea chairman Huw Jenkins was delighted with the appointment, saying: "We felt we needed to get the managerial situation resolved as soon as possible and while the timing is not always perfect, we can look forward to the second half of the campaign with renewed optimism.
"Carlos' time at Sheffield Wednesday, which included securing two consecutive play-off places, highlighted that he has great character and personality to lead the squad and the football club, which is vital at such a crucial time.
"He is driven and ambitious and while he has a big challenge ahead of him, I know he will tackle it without fear."
We are delighted to confirm the appointment of Carlos Carvalhal as the club’s new manager.
— Swansea City AFC (@SwansOfficial) 28 December 2017
Full story https://t.co/UV8NFIhxzD