I have recently learned that when spraying a can of compressed air (the ones you buy in the store) it is very cold and will freeze things especially if you hold it upside down. I know that these air cans don't contain regular air, so my question is can i achieve the same freezing effect using regular atmospheric air? And if so how do i do it?
Very likely the gas in the can is not air at all but rather some non-flammable hydrocarbon gas that's environmentally safe by today's standards. Freon was once used, but that's no longer considered safe for the ozone layer. I believe this to be so because of the comment you made - that there is a difference when the can is inverted.
For the typical aerosol can with seams I do not believe you can compress air to a high enough pressure to get a freezing temperature upon expansion of the gas through a the typical aerosol can size valve. In comparison I do know however that SCUBA tanks can create freezing temperatures at the valve upon release of the air compressed within. SCUBA tank pressures range from 2000 to 3000 psig, much higher than the typical aerosol can is able to withstand. And the cooling effect for a SCUBA tank is independent of whether the tank is upright or inverted. I know this from experience.
Very likely the gas in your can is a hydrocarbon.
When you shake the can do you hear or 'feel' resistance of a of what might be a liquid within?
When you invert the can and spray it do you see a 'mist' or liquid being ejected?
What do the contents labeling say?