When I moved to New York City, people told me over and over: “It’s so expensive!”

They were right. NYC, LA, Boston, DC, San Francisco—all busy cities with great opportunities. But the coveted jobs and access to culture come with price tags as high as the buildings. From rent to groceries, you’ll need to find ways to cut down on those big expenses.

Can you stick to a budget in a big city? Absolutely. Do you need a six-figure income to enjoy the urban life? It doesn’t hurt, but anyone can stretch their city dollars with a little planning.

There are two requirements to being able to afford living in NYC or any big city:

  1. Keep your largest expenses (housing and transportation) as low as possible.
  2. Prioritize your discretionary spending and track it religiously.

Renting

Renting will likely be your biggest expense. According to Zumper’s National Rent Report, a one-bedroom apartment in Minneapolis averages $1,150 a month. In Boston, the average is $2,250.

Despite the surge in costs, rental markets in large cities tend to be competitive. Here’s what to look for when finding an apartment.

As a rule, how much rent you can afford equals 30 percent of your income. Another way to look at it: Your annual income should be 40 times your monthly rent. Landlords may even require you to meet these affordability maximums before renting to you. Obviously, you should aim to spend the lowest percentage of your income on rent that you can get away with and tolerate. But in places like NYC or the Bay Area, finding an apartment that costs less than 50 percent of your income might be laughable.

If that ratio seems impossible to you at first glance, you’re not alone. We’ll cover ways to cut costs below.

One way to save on rent is to compromise on distance. Rents tend to drop the further you get from the city’s center. Neighborhoods outside the city proper, but that still provide easy access to a bus or train line to the city, may be the way to go. An added bonus: you could get more space for your money.

If you’re in the city daily for work, school, or other responsibilities, you may want to live closer to the action. You’ll save on commuting costs and time. Rents will be higher and spaces more cramped, but you’ll be close to all the city has to offer.

For most city dwellers, living with roommates is essential. Combined incomes and cost splitting make large rents affordable. Multiple roommates mean lower costs, not to mention a division of chores and a possible support network.

If you moved to the city solo, someone’s almost certainly renting a room. Craigslist and rental-focused sites like ApartmentList and LiveLovely can help you find a match. Before you move in, talk with your roommates about financial expectations, such as who’s paying for which utilities.

Is privacy a priority? Budget more money to live on your own. Prepare for a longer apartment search and a more distant location. If you can pay a broker fee up front, going through a broker may help you get the best deal.

Are gas, water, heat, and electricity included in your monthly rent? If not, factor these costs into your budget. Don’t forget Internet! And Keeping the heat down in the winter, or going without air conditioning in the summer, can save more than you’d expect.

Maybe you have non-negotiable preferences, such as laundry in the building or proximity to a gym. Or you’d rather be in a small, multifamily dwelling then a large apartment complex. Keep your options open. Be prepared to cut costs in other areas.

Do you need a building that allows pets or smoking? Do you need disability accommodations, such as elevator access? You have options, but they may not be the cheapest or most readily available. Ask questions. Get as much information as possible in writing.

Start your search early, two to three months in advance if you can. Leave time for a credit and reference check before you move in.

Related: How To Optimize Your Apartment Hunt

Buying

Most city dwellers rent, but not all of them. If you’re planning on staying in the area more than five years, buying a home could save money over time and possibly be a sound investment. Although we at Money Under 30 believe you shouldn’t view your primary residence as an investment, real estate in cities where space is at a premium (think New York, San Francisco and Boston) tends to appreciate consistently. This calculator can help you figure out if renting or owning is a better option for you.

Owning a house in which you rent out rooms—being a landlord yourself—is one way to save. So is living outside of the city but within commuting distance.

Taxes are higher in big cities. With more state and income taxes to pay, you’ll want to consider the effect of property tax on your budget.

The downside to buying in the city is that even the least expensive properties are anything but inexpensive. You’ll need a decent income and good credit to qualify for what could be a very large mortgage. Learn more about how to calculate how much home you can afford here.

If you really want to save, do NOT bring a car. In some metropolises like New York or Chicago, you often don’t need one to get from place to place. No gas expenses, oil changes, or parking nightmares necessary.

In other cities, like sprawling Los Angeles, a car may be essential. Carpool if and when you can. Know the public parking laws to avoid tickets and fines. And don’t drive if you don’t have to. Owning an inexpensive car you drive on a need-to-use or emergency basis may be a reasonable compromise.

Public transit

Get to know the bus and train routes. Most large cities have an efficient public transportation network. They also have price deals designed for commuters.

Buy a monthly pass if you ride daily. If you’re not a regular rider, day or weekly passes may meet your needs. If you use public transit only occasionally, skip the pass and pay the fee per ride.

Whatever option you choose, budget the fee into your calculation of expenses. Some systems, but not all, charge more if you ride longer distances. Buses can be cheaper than trains or subways, but prepare for a longer commute.

Walking and biking

Weather permitting, your feet are the cheapest and healthiest way to get around. You might even save on gym costs. Less money, though, means taking more time.

Try a transit navigation app, which calculates the distance and cost from Point A to Point B for multiple transportation methods. (Google Maps works too.)

Bikers, know the rules of the road. Travel on bike lanes if possible. Invest in a good lock.

Taxis and ride-sharing

Taxis are best used sparingly. Even with ride-sharing apps like Uber and Lyft or services like Zipcar, costs can add up. Take one in a time crunch, in bad weather, late at night, or to a place not served by public transportation.

Daily spending: Keep a record

One great thing about a big city is the abundance of choice. Shopping, entertainment, food…everything’s available. With so many opportunities nearby, it can be easy to lose track of your purchases.

The trick is to take charge. Record what you spend weekly, then monthly. Daily coffees stack up quickly. So do water bottles at newsstands.

Once you’ve got a grip on what you spend each month, figure out what you need and what doesn’t do you much good. Then plan your purchases. A curb on impulse spending helps you save for the occasional meal out or new outfit for work.

Don’t be alarmed if transition expenses seem high, such as buying the essentials for a new apartment. The day-to-day will be more manageable.

Continue to keep the record, though, and keep perspective. Once you get over the sticker price shock, the higher costs of everything in the big city may begin to seem routine, and you won’t notice how much you’re spending (that’s what happened to me.)

If you can’t keep up with tracking every penny you spend (and few of us can), learn what’s left over after your fixed expenses and savings and prioritize how you want to spend those discretionary dollars. It’s all about priorities!

Related: How To Create And Use A Personal Budget

Food: Plan meals ahead of time

Big cities have great, diverse food—often at high prices, but not always.

Planning meals, whether eaten in or out, will make it easier to avoid being stuck hungry at a location where a pricey restaurant’s the closest option. The occasional spontaneous trip is fun, but as a rule, know where you’re going (or ordering from) ahead of time and how much it will cost.

Carry snacks and water! Food that can travel—sandwiches, fruit, granola bars—work well for an urban, on-the-go lifestyle.

Grocery shopping can be pricey in the city, and may not seem attractive if you have limited kitchen space. It’s still a good idea to stock up on cooking basics. Larger stores have better prices than the more convenient street-corner bodegas. They’re worth the trip.

If you spot a deal, remember where you got it. This applies to grocery stores and restaurants alike. Diners and out-of-the way spots usually offer good deals at reasonable prices.

Keep an eye on publications and blogs in your city that write about affordable places to eat. If you’re a student, bring your student ID for potential discounts.

Related: Compare These Food Subscription Services For The Times You Can’t Make It To The Market

Another benefit to a big city: there’s always something to do. Events are often low-cost or free.

Summer concerts in the park, art gallery openings, film screenings, no-cover comedy shows…cities are great places for unique events intended to attract new participants. If you don’t mind the crowds, and if you don’t spend much once you’re there, free attractions can fill your schedule.

Local blogs and papers are great places to find out what’s happening.  Most museums will have certain hours or days with reduced-price or free admission. Again, a student ID comes in handy.

No matter what: Be creative!

Plan for the unexpected. Challenge yourself. Maybe you’ll find a low-cost restaurant you’d never thought to try, find a new favorite store with great prices, or feel at home in a neighborhood you hadn’t heard of before.

Living in the city broadens your horizons. With planning, an open mind can be as valuable an asset as a trust fund.

Read more:

  • The 20 Best Cities In America To Be Young, Broke, And Single
  • 10 Cities With Affordable Housing And High Wages