How Much Clearance Is Needed Between a Gas Stove and a Wall?

All cooktops, gas and otherwise, need a minimum of 1 1/2 inches of clearance from the closest adjacent sidewall. Additionally, they need 30 inches of clearance below the underside of a cabinet. Below the cooktop, there is no need for any clearance.