The vast majority of anime are at least partially set in Japanese high schools... but the depictions aren't always accurate. How do anime high schools compare to the real thing?
There's no single answer to that question because each school makes its own rules. However, there are some broad trends. Japanese schools can be incredibly strict, prohibiting their students from having hair that isn't black to going to karaoke or arcades outside of school. They tend to be deeply involved in students' personal lives, beyond what is depicted in anime where authority figures often don't exist. Events like the culture festival do exist and are often just as important in real life as they are in anime - though they'll rarely be as risque as some anime festivals are.
There are plenty more ways that anime depictions of school life don't exactly align with the real world, so let's learn about it.
One thing that often doesn't come up in anime are the strict rules about transportation. Students are often banned from driving to school. Instead, they have to walk, bike, or take public transportation. While taking public transportation, they are often required to stand, in order to leave seats open for elderly or disabled people - no word on what is expected from disabled students.
Students also must arrive alone or with other students - they are not to be dropped off by parents, relatives, or friends who don't attend the school. This is in the name of public safety.
This kind of thing often doesn't come up in anime, since character's relationships with their classmates are usually considered more important than parental ones, and there's nothing unusual about walking to school or taking public transportation. Still, some of these prohibitions may come as a surprise.
One of the strangest aspects of high school life in anime is a large number of students who live by themselves. Unlike in America, this can happen without child protective services getting involved, but it's not nearly as common as anime makes it seem. In real life, on the rare occasion that it does occur, it's because a student got into a prestigious high school that's far from home and doesn't offer housing. In that case, parents with the means to do so may rent out an apartment for their child.
However, this is not only unaffordable for many parents, but also undesirable. Just like parents anywhere, Japanese parents want to make sure that their underage children are properly cared for. Even those who allow it may insist that their kids come home on weekends, or at least check in regularly.
In anime, students often aren't allowed to have part-time jobs outside of school and can be severely punished if they do. That's why Anzu from Yu-Gi-Oh! was once successfully blackmailed by someone who took a photograph of her working at a fast food restaurant - if her school found out, she'd be toast. This is actually reflective of reality. While each school sets its own rules, many schools do choose to ban students from working on the grounds that they want them to focus on their studies and on school clubs.
In anime, students are almost always seen wearing their school uniforms. In reality, most schools do require a uniform of some kind. However, these uniforms tend to be plainer than what appears in anime. It's unlikely that a real Japanese student would have a uniform with a pastel pink mini skirt - rather, it would be a longer skirt in a more conservative color, like navy or beige. The range of uniform styles isn't quite as wide as it is in anime either - most schools stick to a few basic designs, including blazers with pants or a skirt, sailor uniforms, or the gakuran - an all-black uniform with a high neck and gold buttons.
However, not all schools require uniforms. Some allow students to wear street clothes, or to construct their own uniforms from popular uniform supply companies. In a school like this, there might be clothing trends, but no two students will be dressed exactly the same.