Aryl sulfonic acids are produced by the process of sulfonation. Usually the sulfonating agent is sulfur trioxide. A large scale application of this method is the production of alkylbenzenesulfonic acids:
In this reaction, sulfur trioxide is an electrophile and the arene is the nucleophile.  The reaction is an example of electrophilic aromatic substitution. 
Alkylsulfonic acids can be prepared by many methods. In sulfoxidation, alkanes are irradiated with a mixture of sulfur dioxide and oxygen.  This reaction is employed industrially to produce alkyl sulfonic acids, which are used as surfactants.
Direct reaction of alkanes with sulfur trioxide is not generally useful, except for the conversion methanesulfonic acid to methanedisulfonic acid.
Many alkane sulfonic acids can be obtained by the addition of bisulfite to terminal alkenes.  Bisulfite can also be alkylated by alkyl halides:
Sulfonic acids can be prepared by oxidation of thiols:
This pathway is the basis of the biosynthesis of taurine.