The invention losslessly encodes multidimensional data such as a color lookup table in which neighboring elements in a space have high correlations, by a simple arrangement at a high compression ratio. To this end, a multidimensional data input unit inputs data of an X-Y plane in an order of Z=0, 1, 2, . . . from a lookup table expressed by three-dimensional X-, Y-, and Z-coordinates. An inter-plane difference generation unit calculates differences D between elements of two neighboring planes, and outputs the calculation result as two-dimensional inter-plane differences. A prediction error generation unit considers data Di of interest in the inter-plane differences D as an element of two-dimensional data, and outputs a difference e from a predicted value p, which is obtained with reference to already encoded data, to a prediction error encoding unit. The prediction error encoding unit generates and outputs a codeword from the inputted difference e.