javascript convet decimal to binary w3schools code example Example: convert decimal to binary javascript var n = 5; n.toString(2); // "101"