var json = JSON.parse('{"test": "16,64,80"}'); var object = json.test.split(/\s*,\s*/).reduce(function (object, x) { object[x] = true; return object; }, {});