// convert int to String with given radix String g = Integer.toString( i, 36 /* radix 2 to 36 */ ); // convert String to int when string is encoded with a given radix int i = Integer.parseInt( g.trim(), 36 /* radix 2 to 36 */ );