You need to call or local Building Dept or go on their website and see 'which' Code they are using.
Larger municipalities typically have their own set of building codes (based on the standard ones with variations) while smaller municipalities typically have adopted a version of one of the standard Codes.
At this point in time, many smaller Muni's throughout the country have adopted some version of the IRC (International Residential Code, 2003, 2006, etc). However, there are still some Muni's that are under the older BOCA or other Code standards.
Find out which Code your Muni uses and go from there.
Some Muni's have their adopted Code listed on their website, some don't. Some Code versions can be found online with research, others need to be purchased.
If needed go to iccsafe.org.
Code books are not as easy or simple to read as many DIY or novices would like. Requirements vary for different occupancy and construction types. When figuring out requirements it is important to make sure you are looking under the right section for the type of structure and occupancy you have.
As I have to tell clients all to often, "The Code is not a ceiling to reach but a floor to work up from".
As someone else mentioned the Code is a minimum standard not a maximum. In many respects following Code is more than sufficient. However, that doesn't mean you shouldn't consider improving on it for your particular situation as relevant.