An encoding device that quantizes and codes input signals in which an upper limit of a symbol amount of a binary symbol generated by quantization is specified, comprising: a signal processing circuit that processes an input signal in a predetermined method; a quantization parameter generating circuit that generates a first quantization parameter; a first quantizing circuit that generates first quantized data by quantizing the processed input signal on the basis of the first quantization parameter, a first binarizing circuit that binarizes the first quantized data to output first binary symbol data; a first arithmetic coding circuit that generates first coded data by arithmetic-coding the first binary symbol data on the basis of a predetermined target code amount; a quantization parameter calculating circuit that generates a second quantization parameter on the basis of a symbol amount of the first binary symbol data, a code amount of the first coded data, an upper limit of the symbol amount which is an upper limit of an amount of symbols to be entered into the encoding device, and the target code amount; a second quantizing circuit that generates second quantized data by quantizing the processed input signal on the basis of the second quantization parameter; a second binarizing circuit that binarizes the second quantized data to output second binary symbol data; and a second arithmetic coding circuit that generates and outputs coded data corresponding to the input signal by arithmetic-coding the second binary symbol data. wherein the quantization parameter calculating circuit: generates a first parameter candidate on the basis of the first quantization parameter, the symbol amount of the first binary symbol data, and the upper limit of the symbol amount, generates a second parameter candidate on the basis of the first quantization parameter, the code amount of the first coded data, and the target code amount, and compares the first parameter candidate with the second parameter candidate, and sets, to the second quantization parameter, one of the first and second parameter candidates such that the code amount of the coded data to be generated is smaller. a signal processing circuit that processes an input signal in a predetermined method; a quantization parameter generating circuit that generates a first quantization parameter; a first quantizing circuit that generates first quantized data by quantizing the processed input signal on the basis of the first quantization parameter, a first binarizing circuit that binarizes the first quantized data to output first binary symbol data; a first arithmetic coding circuit that generates first coded data by arithmetic-coding the first binary symbol data on the basis of a predetermined target code amount; a quantization parameter calculating circuit that generates a second quantization parameter on the basis of a symbol amount of the first binary symbol data, a code amount of the first coded data, an upper limit of the symbol amount which is an upper limit of an amount of symbols to be entered into the encoding device, and the target code amount; a second quantizing circuit that generates second quantized data by quantizing the processed input signal on the basis of the second quantization parameter; a second binarizing circuit that binarizes the second quantized data to output second binary symbol data; and a second arithmetic coding circuit that generates and outputs coded data corresponding to the input signal by arithmetic-coding the second binary symbol data. wherein the quantization parameter calculating circuit: generates a first parameter candidate on the basis of the first quantization parameter, the symbol amount of the first binary symbol data, and the upper limit of the symbol amount, generates a second parameter candidate on the basis of the first quantization parameter, the code amount of the first coded data, and the target code amount, and compares the first parameter candidate with the second parameter candidate, and sets, to the second quantization parameter, one of the first and second parameter candidates such that the code amount of the coded data to be generated is smaller. generates a first parameter candidate on the basis of the first quantization parameter, the symbol amount of the first binary symbol data, and the upper limit of the symbol amount, generates a second parameter candidate on the basis of the first quantization parameter, the code amount of the first coded data, and the target code amount, and compares the first parameter candidate with the second parameter candidate, and sets, to the second quantization parameter, one of the first and second parameter candidates such that the code amount of the coded data to be generated is smaller.