When it comes to whether marijuana should be legalized, voters in Pennsylvania are divided, but show strong support for its medicinal qualities. 

A new poll from Quinnipiac University found that 47 percent of residents support legalizing marijuana, while 49 percent oppose it, a result within the 3 percent margin of error. 

RELATED: Philly weed arrests dip sharply in first month after decriminalization

There are big differences across age and gender lines, the poll found. Voters under 34 years old want legalization 2-to-1. Voters over 65 oppose by the same margins. Men want legalization 52 to 44 percent. Women are opposed 53 to 43 percent. 

The upside for weed advocates? Nine out of 10 voters support medical marijuana.

RELATED: Marijuana advocates bend Tom Wolf's ear

Just 15 percent of people in the state said they would definitely or probably use marijuana if it were legalized. 

The poll was conducted by Quinnipiac University, which surveys Pennsylvania because of its importance as a swing state in presidential politics. 

RELATED: As laws change, the 'M' word still banned in certain stores

The results come as weed advocates have chalked up a victory in Philadelphia. They have pushed hard for changes at the state level.