Despite notoriously high home prices, four Northern California zip codes — three of which are in the Bay Area — have been named in the top 30 best places to raise a family in the United States by HomeUnion, a real estate investment management firm.

That's not as great an accomplishment as it initially sounds. HomeUnion's findings were compiled by looking at the 50 largest metro areas in the United States, meaning the placement of zip codes in San Anselmo (No. 30), West San Jose (No. 29), Walnut Creek (No. 28), and Rocklin (No. 16), aren't actually that incredible — they're just the best in their area.

Here's how it broke down: HomeUnion first scoured each metro area to find the neighborhoods with the lowest median sale prices for single-family homes (sold between late 2016 and early 2017).

One of the most memorable homes in television history could now be yours!

Media: ZMG San Francisco

Next, they used public school data from Maponics, a website that collects data about neighborhoods and local public services, among other things (the site is now part of Pitney Bowes). They were looking for an average school rating in at least the 80th percentile. If a metro area didn't have a zip code that met both criteria, it was dropped from the list of the top 30.

The top honor went to Blue Springs, Mo. (zip code 64014), near Kansas City. Behind that was Tuttle, Okla., near Oklahoma City, and Fenton, Mo., near St. Louis. 

See all 30 metro areas that landed on their list in the above gallery.

Alyssa Pereira is an SFGATE staff writer. Email her at apereira@sfchronicle.com or find her on Twitter at @alyspereira.