Any number starting with a 0 is considered octal by Javascript. That means that your number equals 1 x 8 squared (0100) plus 1, or 65. If you want to convert it to decimal, multiply it by 1 (0101 * 1) or try parseInt('0101', 10). For decimal conversion, I've had better results with the multiplication than with parseInt().