The Question : 1561 people think this question is useful How do you convert decimal values to their hexadecimal equivalent in JavaScript? The Question Comments : Just a warning here that is you are starting from a string representation its very easy to lose precision when you turn it into Number as part of converting