Convert data to binary