When I moved to New York from Chicago last April, I had an awful lot of trouble picking a neighborhood. I looked at apartments almost everywhere—Williamsburg, Park Slope, Carroll Gardens, Chinatown, Tribeca, Soho, the Lower East Side, Greenwich Village—and each seemed to have its own pitfalls and charms. Eventually, I settled on a place just off Atlantic Avenue in Brooklyn Heights, a neighborhood that, ironically, hadn’t been on my not-so-short list originally. I’ve been happy here, but like most New Yorkers, I suffer from a bit of grass-is-greener syndrome. Would I be better off living in Astoria? Prospect Heights? Chelsea?

It is of course impossible to come up with a completely objective answer to that question, but there is value in trying to understand and measure livability. Luckily, there is a wealth of information to study. The Bloomberg administration gathers reams of data about almost every element of life in the city—from potholes to infant-mortality rates—as do New York University’s Furman Center and the U.S. Census Bureau. Sites like Yelp provide a reasonably objective perspective on the popularity of neighborhood bars and restaurants. StreetEasy.com and Zillow.com publish the costs of apartment space per square foot. Ethnic diversity is now broken down in much finer gradients than black and white: You want to know how many Albanian-Americans there are in Sheepshead Bay? The answer is 734.

Our goal was to take advantage of this wealth of data and apply a little bit of science to the question. If there was anything that could plausibly affect one’s quality of life in a particular neighborhood, we tried to incorporate it. We sorted the dozens and dozens of statistics we compiled into twelve broad categories: housing cost (as measured on a price-per-square-foot basis, for both renters and buyers), housing quality (historic districts, code violations, cockroaches), transit and proximity (commute times to lower Manhattan and midtown, the density of subway coverage), safety (as measured by violent- and nonviolent-crime rates), public schools (test scores and parent satisfaction), shopping and services (the number of neighborhood amenities, especially supermarkets), food and restaurants (judged by density and quality of options), bars and nightlife (ditto), creative capital (arts venues as well as the number of residents engaged in the arts), diversity (in terms of both race and income), green space (park and waterfront access, street trees), and health and environment (noise, air quality, overall cleanliness).

Of course, not all of these categories are equally important: Most people would value safety over access to cool bars; public schools may be very important to some and not at all to others. The formula we finally devised weighted the categories based on a combination of objective and subjective approaches. On the one hand, we thought about what factors might be most important to five different types of New Yorkers, then averaged their answers together. On the other hand, we conducted an online survey of over 3,000 people nationwide and 700 in New York, asking respondents to rate the factors most important to them. Reassuringly, the two approaches produced very similar results, and we settled upon:

Housing Cost: 25 percent

Transit: 13 percent

Shopping and Services: 9 percent

Safety: 8 percent

Restaurants: 8 percent

Schools: 6 percent

Diversity: 6 percent

Creative Capital: 6 percent

Housing Quality: 5 percent

Green Space: 5 percent

Health and Environment: 5 percent

Nightlife: 4 percent

Perhaps the most difficult decision was how to weight affordability. More expensive neighborhoods are generally more expensive for a reason; the correlation between prevailing rents and a neighborhood’s amenities is high. We went with 25 percent simply because it represents the midpoint between the best-bang-for-the-buck scenario and the cost-is-no-object scenario.

That was not the end of our challenges. How does one define a neighborhood? In the most literal sense, we defined neighborhoods block by block, Census tract by Census tract, corresponding to generally accepted, commonsense boundaries. They vary greatly in size—from about 8,000 people (Todt Hill in Staten Island) to more than 220,000 (the Upper West Side and Upper East Side). So statistics were tabulated on a per-capita or a per-square-mile basis. We assessed 60 neighborhoods in all, though only the top 50 are ranked in these pages.

It was important to go into this much excruciating detail because New York contains an abundance of great neighborhoods. The differences in our list sometimes boiled down to tenths or even hundredths of a percentage point, with the subtlest tweak in how we weighted the component factors—especially cost—sending neighborhoods zooming up or down in rank.

A few of our model’s conclusions are liable to be controversial. The front of the list is dominated by brownstone Brooklyn. This is largely due to how we calibrated the cost variable: Pay slightly less attention to price, and Manhattan starts to dominate; if price matters more, a number of Queens neighborhoods rise toward the top. But this group of Brooklyn neighborhoods is generally the most balanced in the city, with few obvious drawbacks and plenty of charm.

On the other side of the spectrum are the Upper East Side and Upper West Side, which ranked just 35th and 36th, respectively. These are large neighborhoods, and some individual parts of them might have ranked higher. But the principal issue is value. Compare Brooklyn Heights and the Upper West Side: They score within a few points of each other in most categories (including transit—commute times to Union Square are identical, at eighteen minutes). But Brooklyn Heights is about $1,000 a month cheaper for a comparable two-bedroom apartment. Likewise, compare Harlem, which ranked a disappointing 50th, to Fort Greene, which placed 18th. Fort Greene wins out in schools, safety, creative capital, housing quality, diversity, shopping, food—and affordability.

The East Village and, especially, the Lower East Side scored better than some might expect. Although nightlife makes up just 4 percent of the ratings, it does make some difference in these cases: The LES would fall three places without it, and the East Village would move from tenth to sixteenth. But these neighborhoods are appealing even to those who would never venture into a bar, as they also have excellent restaurants and shopping, and are more diverse and less expensive than their immediate neighbors.

The top 25 include a pretty even mix of Manhattan, Brooklyn, and Queens, of more affordable and less so, of hip and square. This is not a reflection of our methodology so much as a reflection of neighborhood life in New York. Of course no static set of rankings can—or should—completely satisfy any one individual. Livability means different things to different people. Our Livability Calculator allows you to determine for yourself which factors are most important and see how the rankings re-sort themselves to point to your ideal neighborhood. But not even the most thorough and personalized statistical analysis can override a gut feeling: that sensation of stepping out of the subway and knowing that you are home.

1. Park Slope

15th St. to Flatbush Ave., Prospect Park West to Fourth Ave.

No neighborhood is the butt of more stroller jokes or the recipient of more anti-gentrification scorn. But any way you slice it, Park Slope is the very definition of a well-rounded neighborhood. Of the dozen categories we tallied, it falls just slightly below average in two: affordability (the average two-bedroom rental is $2,275) and diversity. In all other areas, it’s somewhere between above grade and superlative: It’s blessed with excellent public schools, low crime, vast stretches of green space, scores of restaurants and bars, a diverse retail sector, and a population of more artists and creatives than even its reputation for comfortable bohemianism might suggest (more, in fact, than younger, trendier Williamsburg). It might not be everyone’s idea of a perfect neighborhood, but statistically speaking (by a hair), there’s nowhere better.

2. Lower East Side

Canal St. to Houston St., East River to Bowery

Suppose we told you about a neighborhood with some of the city’s best nightlife, along with outstanding restaurants and shops. It’s conveniently located in Lower Manhattan. It’s vital and energetic, gentrifying but reasonably diverse. And a two-bedroom apartment costs around $2,300 a month. Sounds too good to be true, but the numbers tell the story. Yes, the Lower East Side has some prominent warts: Its housing stock is fairly run-down. It’s noisy. And not everyone wants to live where they go out. But few other neighborhoods offer such a complete New York City experience at this price point.

3. Sunnyside

Greenpoint Ave. and First Calvary Cemetery to Northern Blvd. (along the census tract), 44th St. and Locust to Van Dam St.

Sunnyside is a hidden gem if there ever was one—though its communities of Armenians, Romanians, Indians, Bangladeshis, Chinese, Koreans, Colombians, and Ecuadorans have known about its attributes for years. It’s flat-out cheap (and not just by New York standards): A typical two-bedroom costs $1,300 a month. And that’s in a safe, quiet neighborhood with better-than-average schools that’s just sixteen minutes to Times Square on the 7 train. Although it’s a bit lacking in restaurants and nightlife, it’s a quick livery ride to both Greenpoint and Astoria.

4. Cobble Hill & Boerum Hill

Union St. to Wyckoff St/Warren St., Fourth Ave. to the harbor

Squeezed between the similarly charming (and high-ranking) neighborhoods of Carroll Gardens and Brooklyn Heights, Cobble Hill offers the best of both of those worlds. It’s one stop closer to Manhattan on the F train than the former, and $200 to $300 cheaper per month than the latter. Smith and Court Streets are among the most interesting and diverse retail corridors in the city, and the housing stock is superb, with beautiful and well-maintained nineteenth-century homes and plenty of modern amenities.

5. Greenpoint

N. 14th St./Nassau Ave./McGuiness Blvd. to Newtown Creek, Newtown Creek to East River



Another surprise—and for a surprising reason: Greenpoint has some of the best public schools in the city, achieving high test scores and parent-satisfaction ratings, in spite of (or perhaps because of) its small population. It is slightly cheaper and safer than adjacent Williamsburg and has a respectable number of restaurants and bars. There are downsides: The retail coverage is patchy, there are few parks, and it sits on top of an underground oil spill that is still being cleaned up after 30 years. But as long as you don’t go swimming in Newtown Creek, it’s a vibrant, affordable place to raise a family.

6. Brooklyn Heights

Atlantic Ave. to Old Fulton St., East River to Court St./Cadman Plaza



Though it’s the most expensive neighborhood in the outer boroughs, Brooklyn Heights is arguably still a good deal. Commute times into the densest parts of Manhattan are faster than all but a few neighborhoods on the island itself. Throw in the newly expanded Brooklyn Bridge Park; perhaps the most beautiful homes in the city (the entire neighborhood is a historic district); and safe, clean, tree-lined streets, and it clearly has a lot to offer. What’s missing? The main retail artery, Montague Street, is underwhelming, and there’s little diversity.

7. Carroll Gardens & Gowanus

15th St. to Union St., Fourth Ave. to Interstate 278 (BQE)



Tree-lined streets, beautiful brownstones with front and back gardens, a diverse array of restaurants and bars, good local delis and Italian markets: Carroll Gardens’s charms are well catalogued. (Its sister neighborhood, Gowanus, splayed along the Superfunded banks of the Gowanus Canal, is desirable primarily for its proximity to said charms.) It scores a bit lower than nearby Cobble Hill because some of its more attractive properties are family-owned and rarely come onto the rental market.

8. Murray Hill

34th St. to 40th St., East River to Madison Ave.



It’s decidedly unhip, which may be why Murray Hill is $500 to $1,000 cheaper per month than most of the surrounding neighborhoods. But it’s extremely safe, the schools are good, and its residences are modern and well maintained (if architecturally middling). The famously fratty neighborhood gets a little extra flavor from its excellent Indian, Korean, and Sichuan restaurants. And though transit access can be a problem in the neighborhood’s eastern reaches, the eventual completion of the Second Avenue subway will solve that problem.

9. Prospect Heights

Eastern Pkwy. to Atlantic Ave., Franklin Ave. to Flatbush Ave.



Though it is invariably thought of as up-and-coming (perhaps because of all the bars and restaurants popping up in recent years), Prospect Heights is in fact a fairly well-established and diverse middle-class outpost. It offers excellent train access to Manhattan, a bounty of green space thanks to Prospect Park, and reasonable rental prices (an average two-bedroom costs $1,675). But the quality of housing varies significantly from block to block, with well-kept brownstones and new developments juxtaposed with properties in a state of disrepair.

10. East Village

Houston St. to 14th St., East River to Fourth Ave.



The neighborhood with the highest concentration of bars in the city (if not the world) scores off the charts in all the expected areas: retail diversity, restaurant density, proximity to nightlife, and desirability to the creative classes, with only schools and affordability truly lacking. With a typical two-bedroom running at about $3,300 per month, it’s expensive. But thanks to nearby NYU, the East Village has more income and ethnic diversity than most of its neighbors.

11. Astoria

36th Ave. to Twentieth Ave./Con Ed Power Plant/19th Ave., Ditmars Blvd./BQE /Northern Blvd. to East River



Most Manhattanites know Astoria only for its beer gardens, but this large—about 170,000 people—and eclectic neighborhood has much more to offer, including reasonably priced housing, strong ethnic clusters that have weathered the first waves of gentrification, good shopping at both local markets and big-box retailers, and pedestrian-friendly streets. The downside is a lack of foliage and park access, as well as a commute that is reasonable to midtown but cumbersome to lower Manhattan.

12. Bay Ridge

65th St. to Interstate 278 (BQE), Belt Pwy. to Shore Rd.



The south Brooklyn standout is safe, quiet, and close to harborside jogging paths and parks. A diverse mix of blue-collar Italian, Irish, and Arab communities take advantage of good public schools, excellent housing stock, and a better-than-you-think food scene. The commute into Manhattan—about 40 minutes to Union Square without waiting or walking time—is pushing the limits of what most people will tolerate, but that’s why rents ($1,275 average for a two-bedroom) remain so affordable.

13. Woodside

Calamus Ave./Maurice Ave./Maspeth Ave. to Northern Blvd., BQEto 44th St. and Locust



While its neighbor Sunnyside scores slightly higher in most categories, Woodside has many of the same good things going for it: low crime, good schools, affordability, and diversity (with a population divided nearly equally among whites, Hispanics, and Asians). Thanks to the plethora of Irish bars around Roosevelt Avenue, Woodside offers a bit more in the way of nightlife.

14. Tribeca

Vesey St. to Canal St., Broadway to Hudson River



By many criteria, Tribeca could be considered the best place to live in the city. It lands in the top ten in eight of the twelve categories we measured, enjoying minuscule crime levels, great schools, tons of transit, well-planned waterfront access, and light-filled loft-type apartments in painstakingly rehabbed industrial buildings. But having already overtaken the Upper East Side as the city’s richest precinct, it is prohibitively expensive, and any traces of racial and income diversity are long gone.

15. Jackson Heights

Roosevelt Ave. to Grand Central Parkway, Junction Blvd./Jackson Mill Rd./94th St. to BQE



Jackson Heights offers something that most Queens neighborhoods don’t: appealing older housing stock. Many of the apartments and co-ops in its extensive historic district feature private gardens. Transit, however, is a challenge: Although Jackson Heights is blanketed with subway stations, commutes to midtown can be sluggish, averaging about 25 minutes.

16. Long Island City

Newtown Creek to 36th St., Northern Blvd./Queens Blvd./Van Dam St. to East River



A discordant mishmash of artists and investment bankers—its twin totems are P.S. 1 and the Citigroup building—Long Island City has one foot planted in Queens (excellent diversity) and the other in Manhattan (very favorable commute times to midtown). Still, the seams sometimes show, as the neighborhood has a fairly high crime rate and poor public schools.

17. Midtown East

40th St. to 59th St., East River to Fifth Ave.



The population of Midtown East shrinks from about 200,000 in the daytime to barely more than 40,000 at night, which makes it tricky to evaluate: It obviously has abundant services during the day, but some businesses close up shop once the commuters are gone. That leaves residents (who pay a whopping $3,725 for the average two-bedroom) with some very expensive restaurants, as well as cheesy faux-Irish pubs. Still, it’s hugely convenient. And although you’ll sometimes hear that midtown has high crime rates, most of that is petty crime, like pickpocketing, directed at tourists; violent-crime rates are very low.

18. Fort Greene & Clinton Hill

Atlantic Ave. to Nassau Ave./Flushing Ave., Pratt Institute/Classon Ave. to Flatbush Ave.



Another dynamic and well-rounded Brooklyn neighborhood. Once predominantly black, it now touches just about every corner of the race-income matrix, including a large black middle and upper-middle class. Much of the neighborhood is in a historic district, and its homes, especially in Clinton Hill, are often majestic. The Pratt Institute gives it some gravity as an artistic center. Its crime and public-school rankings remain below average, however, which is why it’s still cheaper to live here than next door in Boerum Hill or Park Slope.

19. Dumbo & Downtown Brooklyn

Dumbo:Sands St. to East River, Brooklyn Bridge (through to the Brooklyn Navy Yard) to Manhattan Bridge

Downtown Brooklyn: Wyckoff St./Warren St. to Sands St., Flatbush Ave. to Court St./Cadman Plaza



Two half-neighborhoods with glaring weaknesses that look better when combined. Dumbo supplies the art galleries and waterfront access but is expensive; Downtown Brooklyn provides the stadium-seating multiplex and public-transit hub, but is high in crime and bereft of nightlife. This area received the highest score of any (95 points) in our creative-capital category: People in the arts constitute about 20 percent of its workforce.

20. Williamsburg

Flushing Ave. to North 14th St./Nassau Ave./McGuinness Blvd./Meeker Ave., Newtown Creek to Kent Ave.



Few other enclaves inspire the kind of love-it-or-loathe-it partisanship that this one does. But the thing to remember is that Williamsburg is actually a rather large neighborhood, both in population (it’s home to about 125,000 people, about the same as Harlem) and geography. Near the L-train stops, it offers a fantastically hip (or annoying, depending on your disposition) array of bars, restaurants, and shopping, and some sparkling new developments. The eastern and southern borders are more affordable but less safe, and lag in retail density and access to green space.

21. Central Greenwich Village

Houston St. to 14th St., Fourth Ave. to Sixth Ave.

Entertainment options galore, but very expensive—many residents live in subsidized student housing.

22. Flushing, Queens

Horace Harding Expressway to Willets Pt. Blvd., Francis Lewis Blvd./Utopia Pkwy. to Whitestone Expressway and Van Wyck

Dense food-rich downtown surrounded by a mini-suburbia with high-ranking schools and low crime rates. Con: A lifetime on the 7 train into Manhattan.

23. Battery Park & Financial District

Battery Park City: Southern tip of Manhattan to Vesey St., Broadway to Hudson River

Financial District: Chambers St. to southern tip of Manhattan, East River to Broadway

As quiet, safe, and conveniently located as Tribeca, but without much neighborhood life; can feel abandoned at night.

24. West Village

Houston St. to 14th St., Sixth Ave. to Hudson River

There’s a lot to love, which is the problem: Everybody loves it. If it weren’t so expensive, the housing, restaurants, nightlife, and greenery would place it at the top of the list.

25. Flatiron & Gramercy

14th St. to 34th St., East River toBroadway

The league-average hood is mostly bereft of bars and restaurants despite being rebranded as the more fashionable “NoMad” (see more here).

26. Chelsea

14th St. to 29th St., Broadway to Hudson River

Charming in some places (especially its 400-gallery art colony) and less so in others, including some pockets with high crime.

27. Sheepshead Bay, Brooklyn

Sheepshead Bay to Ave. P/Kings Highway, Nostrand Ave./Gerritsen Ave./Knapp St./Shell Bank Ave. to Ocean Pkwy.

Far from the action but close to the sea; quiet, safe, and clean, with good public schools.

28. Soho

Canal St. to Houston St., Lafayette St. to Hudson River

Great bars, restaurants, and retail. Bustling during the day, relatively quiet at night, expensive all the time.

29 Nolita & Little Italy

Canal St. to Houston St., Bowery toLafayette St.

Virtues and vices are similar to Soho; very expensive and too crowded for green space.

30. Brighton Beach, Brooklyn

Atlantic Ocean at the Riegelmann Boardwalk to Neptune Ave., Manhattan Beach at Corbin Place to Ocean Pwy.

A lot of character, homes in good repair, and some fine Russian restaurants. A bit pricey considering the long commute times.

31. Inwood

Dyckman St. to northern tip of Manhattan, Harlem River to Hudson River

In Manhattan, but not of it; on balance, less convenient than many neighborhoods in Brooklyn and Queens.

32. Corona Park, Queens

Long Island Expressway to Northern Blvd., Van Wyckto Junction Blvd.

An affordable haven for immigrant families, with more green space than most parts of Queens; lacks some of the restaurants and shopping of Jackson Heights and Flushing.

33. Red Hook, Brooklyn

Red Hook peninsula between Buttermilk Channel, Gowanus Bay, and Gowanus Canal to Hamilton Ave

A few blocks’ worth of well-regarded restaurants and bars (not to mention Ikea and Fairway) are offset by a large and impoverished housing project and terrible transit.

34. Midtown West

29th St. to 59th St., Madison Ave. to Hudson River

More cultural cachet than Midtown East, but much grittier, with modestly high crime rates (especially around Port Authority) and a high incidence of air, asbestos, and noise complaints.

35. Upper East Side

59th St. to 96th St., East River to Fifth Ave.

Famously safe, charming, green, and beautiful, but other neighborhoods offer those same virtues while also being cheaper and more densely packed with entertainment.

36. Upper West Side

59th St. (excluding Columbus Circle) to 110th St., Central Park West to Hudson River

Some of the most desirable property in the city is on Central Park West, but Amsterdam Avenue is a morass of mid-rises and much of the neighborhood lacks street life.

37. Washington Heights

155th St. to Dyckman St., Harlem River to Hudson River

For better or worse, it has mostly escaped the forces of gentrification; it’s much safer than reputed, with a falling crime rate.

38. Riverdale, the Bronx

Harlem River to Yonkers, Van Cortlandt Park / Broadway to Hudson River

The highest-ranking representative of the Bronx; fairly safe but with subpar public schools and little in the way of restaurants. Better commute times than you’d think: about 30 minutes to Columbus Circle.

39. Sunset Park, Brooklyn

65th St. to 36th St. (along the south end of Greenwood Cemetery), Ninth Ave and Borough Park to Upper New York Bay

Safe and diverse and has some of the borough’s best ethnic restaurants, though not as cheap as Bay Ridge to the south or as charming as Windsor Terrace to the north.

40. New Dorp, Staten Island

Cedar Grove Ave.to Staten Rapid Transit Railroad, Elm Tree Ave. to Oak Ave.

Good middle-class neighborhood with well-maintained homes and virtually nonexistent crime, though the public schools are just average.

41. West Brighton, Staten Island

Forest Ave. to Richmong Ter., Bard Ave. to Clove Rd.

A little more urban than New Dorp; fairly diverse and with a decent retail strip. But crime rates are higher.

42. Chinatown

Chambers St. to Canal St., East River to Centre St.

Overpriced given the housing quality, but more reasonable than Soho. Good schools, but underserved in terms of transit.

43. St. George, Staten Island

Victory Blvd. to Richmond Ter., Bay St. to Westervelt Ave.

Very diverse; has a few blocks near the waterfront with distinct architecture. Most of the neighborhood suffers from a lack of retail and mediocre schools.

44. Belmont, the Bronx

E. 183rd St. to Fordham Rd., Southern Blvd. to Webster Ave.

Cheap rent ($675 on average), terrific Italian food, lots of Fordham students, but also high crime, tenement housing, and poor transit.

45. Co-op City, the Bronx

Relatively low crime rates and a diverse and distinctly middle-class population, but it’s more than an hour’s commute into Manhattan.

46. Morningside Heights

110th St. to 155th St., St. Nicholas Ave. to the Hudson River

Diverse neighborhood, better for grocery shopping than nightlife; higher prices relative to its location, probably because of the captive audience of Columbia professors.

47. Roosevelt Island

In theory, this should be a small town within a big city, but it never quite developed its own retail or street culture; notoriously inconvenient, especially now that the tram is down for repairs.

48. Bedford Park, the Bronx

Hall of Fame Terrace/Aqueduct Ave./Jerome Ave./Fordham Rd. to Woodlawn Cemetery/Moshulu Golf Course/Gun Hill Rd./ Jerome Ave., Webster Ave. and Bronx Park to Golden Ave. and Harlem River

Accessibility, schools, and crime rates hold up well compared to most of the Bronx—but poorly relative to the rest of the city.

49. Parkchester, the Bronx

Cross Bronx Expwy - Westchester Ave. to East Tremont Ave., Castle Hillto Bronx River Pkwy.

Unstellar prewar housing, below-average schools, and long commutes, but an average two-bedroom costs $625 a month.

50. Harlem

Central Harlem: 110th St. to Harlem River, 5th Ave. to St. Nicholas Ave.

East Harlem: 96th St. to Harlem River, East River to 5th Ave.

A surprisingly lackluster performer. Despite radical changes in recent years, crime is still relatively high and the public schools could still use improvement.

See Also:

Don’t like our neighborhood rankings? Create your own using our Livability Calculator.

Nate Silver is the founder and president of the political forecasting website FiveThirtyEight.com.