String foo = "some text"; byte[] fooBytes = foo.getBytes(); BigInteger bi = new BigInteger(fooBytes);