Many families spent summer break chaseing top-rated school districts with communities that offer an appealing lifestyle, small class sizes and walkability, but some came with a hefty price tag.

The data, collected by Realtor.com, shows "out-of-district home shoppers" looked the most between May and July this year at "areas with at least one public school rated 8 or higher." It also focused on districts with an average of at least 100 for-sale properties.

Homes in 27 out of the 50 most sought-after districts came with steep median listing prices, averaging about $1.21 million.

Carroll Independent School District in the Dallas, Texas metropolitan area

Laguna Beach Unified, Orange County, California

Reed Union, San Francisco Bay Area

"School quality has long been a driver of homebuyi

See Full Page