The world of Harry Potter is vast, imaginative, and—simply put—magical. Among the most famous elements of the franchise are Hogwarts houses, the "teams" that every student at the school is sorted into depending on their personality. There's the brave Gryffindors, the ambitious Slytherins, the loyal Hufflepuffs, and the knowledge-driven Ravenclaws.

RELATED:12 'Stranger Things' Characters Sorted Into their Hogwarts Houses

Equally vast is the cast of characters from The Office, the legendary American mockumentary sitcom about the daily life of a paper company office in Scranton, Pennsylvania. It's always fun to imagine what Hogwarts house some fictional characters would be sorted into, and doing so with the characters of The Office is no exception.

Gabe Susan Lewis — Ravenclaw

Gabe Lewis sitting at his desk next to his laptop

Played with astonishing quirkiness by Zach Woods, Gabe is undoubtedly one of the most controversial characters of the show. He's strange, quiet, and often quite a bit annoying.

At his core, Gabe is definitely a Ravenclaw. He has very particular interests which he's deeply knowledgeable about, from Korean soap operas to morbid subjects and horror movies. He's dilligent and hard-working, relatively intelligent, and quite competitive.

Darryl Philbin — Gryffindor

Darryl talking head with his grey warehouse uniform

Friendly and competent, Darryl used to be the warehouse foreman at the office, but his dedication led him up the corporate ladder throughout the course of the series.

Darryl's ambition and power to improve himself is much less Slytherin-like and much more founded on his incredible courage, nerve, and determination. He's constantly standing up for what he believes is right, he's very charming and easy to like, and he's constantly proving that he's one of the most valuable members of the office.

Andy Bernard — Slytherin

Andy Bernard at his manager desk

Andy is one of the characters with the most notable character arcs in the whole show—Which, in his case, was a bit controversial toward the end of the series. He's insecure, expressive, and goal-oriented.

The Sorting Hat would surely have to take its sweet time when deciding where to put Andy; partly because his personality is constantly shifting as the show goes on, and partly because he shows many traits from each of the other houses. But, deep down, Andy is driven by ambition. Even when trying to make his friends happy, a wish for success is always among his motives.

RELATED:The 10 Most Iconic TV Locations, from Saul Goodman's Office to 'The Office'

Oscar Martinez — Ravenclaw

Oscar Martinez sitting at his desk, looking at his computer
Image via NBC

Oftentimes the office know-it-all, Oscar is usually one of the most normal, realistic, and less caricaturistic characters of the entire ensemble. He's rational, intelligent, efficient, and fairly reserved.

More often than not, Oscar can be found playing into the typical Ravenclaw stereotypes. He's very cerebral, very wise, and he can't hold back from correcting his workmates when they make a mistake. He's much more three-dimensional than that, though: He can also be friendly, the voice of reason of the office, and a great source of advice.

Ryan Howard — Slytherin

Kelly staring at Ryan, who's staring at the camera

Ryan is one of the most bafflingly written characters of the entire show. He's a rather hard to describe character in the first three seasons, then he rapidly takes a turn and becomes the primary antagonist of season four, then an occasional antihero in the remaining seasons.

One thing is for certain, and that is that Ryan is a Slytherin through and through. He's cunning and resourceful, using his skills to slowly and inadvertently reach his goals, which are sometimes not particularly ethical.

Pam Beesly — Hufflepuff

Pam sitting at her desk

Pam is a fan favorite of the show, starting out as a passive and shy receptionist but slowly growing into a more assertive and independent saleswoman as the series progresses.

Although the Sorting Hat would surely strongly consider putting Pam in Gryffindor as a Neville Longbottom type, she would surely feel more at home in Hufflepuff. Even as she grows more confident, she remains kind to everyone and loyal to a fault. She values patience and justice, and she's one of the hardest-working people in the office.

Jim Halpert — Gryffindor

Jim Halpert from The Office sitting at his desk
Image via NBC

In many ways, John Krasinski's Jim is the true protagonist of The Office. He's a cunning prankster; funny, charming, and down-to-earth. He can be a bit cruel sometimes, but he's a great guy at heart.

Though Jim would comfortably fit into Slytherin as well due to his quiet ambition and playful resourcefulness, he's far too corageous, chivalrous, and dedicated to not be a Gryffindor. He has a strong moral compass and he's not afraid of taking risks. It's fair to say that he'd get along phenomenally with Fred and George Weasley.

RELATED:10 of Our Favorite Halloween Costumes from 'The Office'

Dwight Schrute — Slytherin

Dwight Schrute with a ginger wig

Dwight, one of the funniest characters of the whole show, is Jim's self-proclaimed biggest enemy. He's clever and ambitious, as well as the hardest-working salesman in Scranton.

Dwight's loyalty to authority and his dedication to what he believes is right would make him a valuable Gryffindor. In the end of the day, though, what Dwight values most are success and ambition. His loyalty, intelligence, and resourcefulness are all directed toward becoming the manager of the office one day, no matter the cost.

Toby Flenderson — Squib

Toby Flenderson sitting at his desk
Image via NBC

Toby is the Human Resources Representative of the office, and the person that Michael most loathes in the entire world. This hatred is contagious, since everyone else in the office also mistreats him at least a few times.

It's fair to say that Toby would likely be a Squib (a magic-less child of magic parents). His mild-mannered and patient demeanor would be perfect for the role. Perhaps he could help Mr. Filch with caretaking duties around the castle, trying his best to avoid Michael.

Michael Scott — Hufflepuff

Michael Scott from The Office sitting in his office
Image via NBC

One of the most iconic characters in sitcom history, played hilariously by the brilliant Steve Carrell, Michael Scott is the manager of the Scranton branch of Dunder Mifflin. He wants nothing more than to be loved, and though his antics can come off as cruel and narcissistic, there is an awful lot of kindness and loyalty deep down in his heart.

Michael is incredibly loyal to the company and to his employees, and he's always looking to make the everyday work environment fun and enjoyable for everyone but Toby. Despite his idiosyncrasies, kindness is his defining characteristic, meaning that he would be able to do a lot of good in Hufflepuff.

KEEP READING:10 Most Epic Beefs in Television History