var str='130,80', hex=str.split(',').map(function(val){ return (val >>> 0).toString(16); }).join(', '); alert(hex);