Which cities are best for freelancers? That’s a difficult question to answer, since it’s dependent on a variety of factors—from local job opportunities to cost of living.

That being said, took a stab at the problem, analyzing more than 150 cities across five metrics: median rent, average internet speed, number of coffee shops per capita, income taxes, and ease of commuting (i.e., “getting around”). Here are their top five cities:

We can debate some of the metrics used here; while some tech freelancers certainly prefer coffee shops as venues to get work done, coffee-shops-per-capita is likely not a deciding factor in many folks’ decisions to move to a new city. Same with average internet speed: given the rate of broadband penetration, it doesn’t seem like a factor that would sway many (unless they’re being forced to move to a place with severely degraded infrastructure, which is a whole different issue).

But rent, mobility, and income taxes—those are all significant things to consider. For the purposes of this study, considered the “average” freelancer income at $52,074 per year, which is actually quite a bit below what many technologists make, according to some studies.

For the purposes of discussion, let’s assume that most freelancers are also remote workers. Recently, a wide-ranging Owl Labs study found that remote work is far more popular among those making above $75,000 per year. Owl Labs reports 18 percent of remote workers are in “facilities, operations, and IT,” while an additional 14 percent are in “customer support” roles, which also overlaps tech jobs; seven percent are in “product or engineering” roles.

Meanwhile, the Dice Salary Survey found that the average tech pro salary hovers around $93,000 per year, and many technologists are freelancers and/or enjoy remote-work privileges. Even then, many tech professionals think their cost of living is astronomical: According to a recent survey by Hired, some 53 percent of tech professionals think they’re compensated fairly given the cost of living in their city, while 47 percent do not.

Based off Dice’s Salary Survey, we crunched the cities with the best cost of living, vis-à-vis your average technology salary. As you can see, places such as Silicon Valley are hellish when it comes to affording things like housing, whereas cities such as San Diego and Washington, DC offer better deals:

In the end, higher salaries mean that many tech-oriented freelancers will have a bit more flexibility when it comes to costs, expanding the number of cities in which they can live comfortably—whether or not there’s actually a coffee shop around.