convert bytes to binary string java code example Example: java integer to binary string int n = 1000; String s = Integer.toBinaryString(n);