"As has been well documented, I smoked pot as a kid and I view it as a bad habit and a vice, not very different from the cigarettes that I smoked as a young person up through a big chunk of my adult life," he said in an interview with The New Yorker magazine
"I don't think it is more dangerous than alcohol."
Smoking marijuana was "not something I encourage, and I've told my daughters I think it's a bad idea, a waste of time, not very healthy", Mr Obama added.
Mr Obama's government has given states permission to experiment with marijuana regulation and laws recently passed in Colorado and Washington state legalising marijuana recently went into effect.
The president said it was important for the legalisation of marijuana to go forward in those states to avoid a situation in which only a few are punished while a large portion of people have broken the law at one time or another.
He said he was troubled at the disproportionate number of arrests and imprisonments of minorities for marijuana use.
"Middle-class kids don't get locked up for smoking pot and poor kids do," he said. "And African-American kids and Latino kids are more likely to be poor and less likely to have the resources and the support to avoid unduly harsh penalties."
He said in the interview that users should not be locked up for long stretches of time when people writing drug laws "have probably done the same thing", but urged a cautious approach to changing marijuana laws, saying that people who thought legalising pot would solve social problems were "probably overstating the case".
"And the experiment that's going to be taking place in Colorado and Washington is going to be, I think, a challenge," the president said.
Ethan Nadelmann, executive director of the Drug Policy Alliance, praised Mr Obama's words, saying his use of the word "important" about the new Colorado and Washington laws "really puts the wind in the sails" of the movement to end marijuana prohibition.
Critics of the new laws raise concerns about public health and law enforcement, asking whether wide availability of the drug will lead to more under-age drug use, cases of driving while high and more crime.