Linear binary code


An \((n,2^k,d)\) linear code is denoted as \([n,k]\) or \([n,k,d]\), where \(d\) is the code's distance. Its codewords form a linear subspace, i.e., for any codewords \(x,y\), \(x+y\) is also a codeword. A code that is not linear is called nonlinear.

Linear codes can be defined in terms of a generator matrix \(G\), whose rows form a basis for the \(k\)-dimensional codespace. Given a message \(x\), the corresponding encoded codeword is \(G^T x\). The generator matrix can be reduced via coordinate permutations to its standard or systematic form \(G = [I_k~A]\), where \(I_k\) is a \(k\times k\) identity matrix and \(A\) is a \(k \times (n-k)\) binary matrix.


Distance \(d\) of a linear code is the number of nonzero entries in the (nonzero) codeword with the smallest such number. Corrects any error set for which no two elements of the set add up to a codeword.

Linear codes admit a parity check matrix \(H\), whose columns make up a set of parity checks, i.e., a maximal linearly independent set of vectors that are in the kernel of \(G\). It follows that \begin{align} G H^{\text{T}} = 0 \mod 2~. \end{align}

The decision problem corresponding to finding the minimum distance is also \(NP\)-complete [1], and approximating the weight enumerator is \(\#P\)-complete [2].


A family of linear codes \(C_i = [n_i,k_i,d_i]\) is asymptotically good if the asymptotic rate \(\lim_{i\to\infty} k_i/n_i\) and asymptotic distance \(\lim_{i\to\infty} d_i/n_i\) are both positive.


Decoding an arbitary linear binary code is \(NP\)-complete [3].Slepian's standard-array decoding [4].


Tables of bounds and examples of linear codes for various \(n\) and \(k\), extending code tables by A. E. Brouwer [5], are maintained by M. Grassl at this website.




  • Binary linear LTC — Linear binary codes with distances \(\frac{1}{2}n-\sqrt{t n}\) for some \(t\) are called almost-orthogonal and are locally testable with query complexity of order \(O(t)\) [6]. This was later improved to codes with distance \(\frac{1}{2}n-O(n^{1-\gamma})\) for any positive \(\gamma\) [7], provided that the number of codewords is polynomial in \(n\).
  • Binary Varshamov-Tenengolts (VT) code — By adapting a construction of Tenengolts [8], binary VT codes can be modified to yield slightly longer linear codes [9].
  • Calderbank-Shor-Steane (CSS) stabilizer code — Construction uses two related binary linear codes \(C_X\) and \(C_Z\).
  • Entanglement-assisted (EA) QECC — Any linear binary code can be used to construct an EAQECC.
  • Entanglement-assisted (EA) stabilizer code — Any linear binary code can be used to construct an EA stabilizer code.
  • Parity-check code — Any \([n,k,d]\) code with odd distance can be extended to an \([n+1,k,d+1]\) code by adding a bit storing the sum of codeword coordinates.
  • Qubit stabilizer code — Qubit stabilizer codes are quantum analogues of binary linear codes.


A. Vardy, “The intractability of computing the minimum distance of a code”, IEEE Transactions on Information Theory 43, 1757 (1997). DOI
M. N. Vyalyi, “Hardness of approximating the weight enumerator of a binary linear code”. cs/0304044
E. Berlekamp, R. McEliece, and H. van Tilborg, “On the inherent intractability of certain coding problems (Corresp.)”, IEEE Transactions on Information Theory 24, 384 (1978). DOI
D. Slepian, “Some Further Theory of Group Codes”, Bell System Technical Journal 39, 1219 (1960). DOI
Andries E. Brouwer, Bounds on linear codes, in: Vera S. Pless and W. Cary Huffman (Eds.), Handbook of Coding Theory, pp. 295-461, Elsevier, 1998.
T. Kaufman and S. Litsyn, “Almost Orthogonal Linear Codes are Locally Testable”, 46th Annual IEEE Symposium on Foundations of Computer Science (FOCS'05). DOI
T. Kaufman and M. Sudan, “Sparse Random Linear Codes are Locally Decodable and Testable”, 48th Annual IEEE Symposium on Foundations of Computer Science (FOCS'07) (2007). DOI
G. M. Tenengolts, Class of codes correcting bit loss and errors in the preceding bit (translated to English), Automation and Remote Control, 37(5), 797–802 (1976).
N. J. A. Sloane, “On Single-Deletion-Correcting Codes”. math/0207197
Page edit log

Zoo code information

Internal code ID: binary_linear

Your contribution is welcome!

on (edit & pull request)

edit on this site

Zoo Code ID: binary_linear

Cite as:
“Linear binary code”, The Error Correction Zoo (V. V. Albert & P. Faist, eds.), 2022.
@incollection{eczoo_binary_linear, title={Linear binary code}, booktitle={The Error Correction Zoo}, year={2022}, editor={Albert, Victor V. and Faist, Philippe}, url={} }
Share via:
Twitter |  | E-mail
Permanent link:

Cite as:

“Linear binary code”, The Error Correction Zoo (V. V. Albert & P. Faist, eds.), 2022.