1. A memory system comprising: a non-volatile memory; a memory interface that performs programming and reading out with respect to the non-volatile memory; a code processor that generates a code word by encoding; and a controller that sets a threshold-voltage read level for determining whether a value of each bit in a received word read out from the non-volatile memory is a first value or a second value, wherein a difference between the number of bits which have the first value and the number of bits which have the second value in the code word depends on a code rate of the encoding, and the controller obtains the threshold-voltage read level based on the code rate.