It comes with a high price tag and time commitment, but lots of jobs seem to want a degree beyond a bachelor’s or associate’s. So, is grad school worth it?

According to the Bureau of Labor Statistics, the simple answer is yes. Those with doctoral degrees, professional degrees, or master’s degrees have higher median usual weekly earnings and lower unemployment rates. While there are counterpoints to this idea (like Bill Gates, Steve Jobs, or Oprah, who made their wild successes without obtaining any degrees in higher education) and data showing that an electrician or plumbing apprenticeship may be a better investment than either a B.A. or a Ph.D., generally speaking the higher degree of learning you have, the higher your weekly income.

But this is all in the abstract—and your real-life situation may not appear so simple as a bar chart. What about the tuition costs, the investment of your time and effort, the job opportunities and earning years you give up in the meantime, and the possibility that it might not work out the way you want?

The question most people need to ask first is: can I afford the short-term pain for the potential long-term gain? There are also differences in every industry and every degree program—some, like a medical degree, will get you a monetary return on investment sooner than an MFA in painting. Earnings vary by industry, demographics, and location, and of course by individual, and a graduate degree does not automatically line your pockets with more cash each week. (In the short-term, it will do the exact opposite.) Degrees also gain and lose earning potential over time; going to law school was a much better bet in the year 2000, before natural learning search algorithms eliminated much of the entry-level work, than it is today. You may also consider other factors like the value the graduate degree has beyond earning potential.

But no matter what type of degree you seek, it is work and it is a gamble. So here are a few factors to consider before you fill out your FAFSA and brush up on your math skills for the GRE.

If you are currently employed and the company will pay for it:

Take advantage of professional advancement programs within your current job. If your employer helps pay for grad school and you can juggle courses and your day job, then go for it. This helps take care of one of the main drawbacks of graduate school: going broke. Depending on the degree program, universities might even offer stipends and assistantships.

Getting funding assistance of any kind is one of the key bonuses that can help you get that degree to take you further in your professional endeavors. And, if you can remain gainfully employed while seeking a degree, your personal risk is considerably diminished. At the very least, you won’t need to find a new job if the degree program does not pan out.

If you consider your qualifications for future positions:

For some positions, you simply need a graduate degree. Librarian? Yes. Architect? Yes. Doctor? Yes. If the dream job you always see posted on your favorite job website requires a graduate degree, then it’s time to seriously consider investing in that future to make the dream achievable. The trickiness of the situation comes when you make yourself overqualified for other positions. For example, if you have a graduate degree in marketing, but have no job experience, you may be screened out of the applicant pool for entry-level jobs. In cases like this, it is vital to explore internship opportunities while in school and cultivate real-world work experience too.

If the degree has value beyond earning potential:

If you simply have a love of learning or a passion you want to follow, is it worth it? This is the case where “worth” may be defined beyond the monetary value. This means you will enjoy grad school with its challenges, but you may set yourself back monetarily for a few years. If you want a degree in art history, there’s no guarantee you will ever get a job as a museum conservator. You may still end up with a sales job and a vast knowledge of 16th century painters in your head.

Beyond personal enrichment, there are other types of value for a graduate degree—for example, if the program offers good connections and internships. This can help with careers that are harder to break into like television, acting, or journalism.

If you consider the money now vs. money in the future:

Degrees with more immediate pipelines to job opportunities (like nursing, law school, or an MBA program) tend to charge tuition; artist’s MFA degrees or a PhD in academic subjects that are less market-oriented tend to offer tuition remission, stipends, assistantships or on-campus jobs. (If they don’t, then it’s much less worth it; don’t go into debt for a nonprofessional graduate degree!) If you’re not in a professional degree program, the lean years may extend a bit longer beyond grad school, and you may only gain success years later as you work towards your goal around your day job.

If you are considering using the degree to teach at the college level:

The job market for professors has stagnated over the last decade, with a severe glut of degree holders and a dearth of jobs teaching full-time in university departments. Increasingly those earning a PhD in programs of study that can last 5-10 years are seeking out “alt-ac” jobs—meaning nonacademic jobs—or spending years doing low-wage, low-security teaching work before leaving the profession. Do the research on your field and its job prospects before you commit to spending so many of your prime earning years in graduate school for a teaching career that might never materialize, no matter how smart you are or hard you try.