 <pre><code>result = [] z = ActiveSupport::JSON.decode( '{ "0X1W6": "{\"type\":\"Hourly\",\"hr\":\"12\",\"min\":\"30\",\"every_hr\":\"5\"}", "Tk18f": "{\"type\":\"Daily\",\"hr\":\"12\",\"min\":\"30\",\"days_checked\":[1,4]}" }') z.each_value do|i| x = {} ActiveSupport::JSON.decode(i).each{|k,v| x[k.to_sym] = (v.class == String &amp;&amp; v.to_i.to_s == v) ? v.to_i : v } result &lt;&lt; x end </code></pre>