An encoder that encodes a frequency spectral sequence of an audio signal on an individual frame, which is a predetermined time segment, basis, the encoder comprising: a quantizer that obtains a quantized spectral sequence which is a sequence of integer values by dividing frequency spectral values of the frequency spectral sequence by a quantization step size s; an integer transformer which, where p is an integer greater than or equal to 2 and N' is a positive integer that makes the product of p and N' equal to N, obtains N' integer sets, each being made up of p integer values, from the quantized spectral sequence which is a sequence of N quantized spectra in accordance with a predetermined rule, obtains a unified quantized spectrum, which is one integer value, for each integer set by a bijective transformation, and obtains a unified quantized spectral sequence, which is a sequence of the obtained N' integer values; and an integer encoder that obtains an integer code by encoding each of the N' unified quantized spectra contained in the unified quantized spectral sequence using N' bit assignment values contained in a bit assignment sequence, wherein the encoder further comprises: an object-to-be-encoded estimator that obtains an estimated unified spectral sequence of N' estimated unified spectra from the frequency spectral sequence by a transformation that is the same as a transformation which is performed by the integer transformer; a bit assigner that obtains the bit assignment sequence and a bit assignment code corresponding to the bit assignment sequence from the estimated unified spectral sequence; and a quantization step size obtainer that obtains the quantization step size s from the estimated unified spectral sequence and the bit assignment sequence. a quantizer that obtains a quantized spectral sequence which is a sequence of integer values by dividing frequency spectral values of the frequency spectral sequence by a quantization step size s; an integer transformer which, where p is an integer greater than or equal to 2 and N' is a positive integer that makes the product of p and N' equal to N, obtains N' integer sets, each being made up of p integer values, from the quantized spectral sequence which is a sequence of N quantized spectra in accordance with a predetermined rule, obtains a unified quantized spectrum, which is one integer value, for each integer set by a bijective transformation, and obtains a unified quantized spectral sequence, which is a sequence of the obtained N' integer values; and an integer encoder that obtains an integer code by encoding each of the N' unified quantized spectra contained in the unified quantized spectral sequence using N' bit assignment values contained in a bit assignment sequence, wherein the encoder further comprises: an object-to-be-encoded estimator that obtains an estimated unified spectral sequence of N' estimated unified spectra from the frequency spectral sequence by a transformation that is the same as a transformation which is performed by the integer transformer; a bit assigner that obtains the bit assignment sequence and a bit assignment code corresponding to the bit assignment sequence from the estimated unified spectral sequence; and a quantization step size obtainer that obtains the quantization step size s from the estimated unified spectral sequence and the bit assignment sequence. an object-to-be-encoded estimator that obtains an estimated unified spectral sequence of N' estimated unified spectra from the frequency spectral sequence by a transformation that is the same as a transformation which is performed by the integer transformer; a bit assigner that obtains the bit assignment sequence and a bit assignment code corresponding to the bit assignment sequence from the estimated unified spectral sequence; and a quantization step size obtainer that obtains the quantization step size s from the estimated unified spectral sequence and the bit assignment sequence.