Assuming targDexMod is 1 in your example, it looks like targACdodge (and possibly the values after it) are strings, not integers. This is what we get for having a weak-typed language to work with, particularly when we have string-input fields for our characters. =) The interpreter sees 10 + 1 + "0" + ... so it says 10 + 1 = 11, 11 + "0" = "110", "110" + "0" = "1100", etc. There are a few ways to force a variable to get treated as an integer. The shortest to write is the identity operator: +targACdodge . While it's the shortest, it's the more error-prone when converting from strings (getting NaN and such instead of what you intended), and it also makes it terribly difficult to read when you've got a series of summed values. (I often use this when throwing together scripts on-the-spot in the forums, specifically because it's fast to write.) The fastest to process is bitwise OR with 0: targACdodge | 0 . It still suffers the problem of being difficult to read in a series of sums, though, and it's difficult to understand what's going on for someone unfamiliar with bitwise arithmetic. The most robust option is the parseInt function: parseInt(targACdodge) . You can also supply a second argument as a radix, but it's unlikely someone has entered the target's AC in binary or hexadecimal, so you probably don't need it. parseInt works as you expect it to on the widest range of strings. In JavaScript, this is called type coersion (particularly the first two; the third option would usually be called string parsing) . So, you could use any of: var targAC = 10 + +targDexMod + +targACdodge + +targACnatural + +targACdeflect + +targACmisc + +targACtemp;
var targAC = 10 + targDexMod|0 + targACdodge|0 + targACnatural|0 + targACdeflect|0 + targACmisc|0 + targACtemp|0;
var targAC = 10 + parseInt(targDexMod) + parseInt(targACdodge) + parseInt(targACnatural) + parseInt(targACdeflect) + parseInt(targACmisc) + parseInt(targACtemp); Assuming the other variables are strings-as-numbers with nothing special going on, all of those options will work the same. The second one will be a very teensy tiny bit faster than the other two, but the difference is completely negligible. Of course, you could also parse the string as an integer when you first assign the targAC variables, rather than at the point you sum them together. It's up to you.