The aim of the current study was to fabricate naturally derived polymer based hydrogels for controlled release of diclofenac sodium (DS) for a long duration of time. In this research work, sodium alginate-co-poly(2-acrylamido-2-methyl propane sulphonic acid) (SA-co-poly(AMPS)) hydrogels were prepared by the free radical polymerization technique, where sodium alginate (SA) and 2-acrylamido-2-methyl propane sulphonic acid (AMPS) were used as the polymer and monomer while ammonium peroxodisulfate (APS) and N,N′-Methylene bisacrylamide (MBA) were used as the initiator and cross-linker, respectively. A swelling study was performed to determine the swelling index of developed hydrogels in both acidic (pH 1.2) and basic (pH 7.4) media and pH-independent swelling was observed due to the presence of AMPS. An in vitro release study was conducted to evaluate the percentage of drug released, and a high release of the drug was found at the higher pH of 7.4. Sol–gel analysis was performed to analyze the crosslinked and uncrosslinked part of the hydrogels, and results showed a rise in gel fraction as the composition of SA, AMPS and MBA increased while the sol fraction decreased and vice versa. This work demonstrated a potential for sustained delivery of diclofenac sodium by employing various concentration of SA, AMPS and MBA.