Abstract: A two-dimensional square constraint encoding and decoding method and device, relating to the fields of data storage and data communication. The encoding method includes caching a one-dimensional data stream, and dividing the one-dimensional data stream into several sets of one-dimensional 2-bit data; according to an encoding table, encoding each set of 2-bit data into a 3*2 two-dimensional codeword in sequence by an encoder, and then cascading all the two-dimensional codewords into a two-dimensional constraint array in a specified order; the decoding method includes reading the two-dimensional constraint array by a decoder, and dividing the two-dimensional constraint array into several 3*2 two-dimensional codewords; decoding each two-dimensional codeword into the one-dimensional 2-bit data in sequence through a decoding table, and then successively assembling the generated one-dimensional 2-bit data into the one-dimensional data stream and outputting.