Two-weight code 


A linear \(q\)-ary code whose codewords all have one of two possible nonzero Hamming weights.


See [1,2] for overviews of two-weight codes and Refs. [3,4] for examples.There is a classification of two-weight codes of length 40 [5] as well as of \([n,m,d]_q\) codes with the two weights \(n,d\) [6].Sizes of maximal two-weight, three-weight, and four-weight binary codes have been determined [7].




  • Divisible code — Two-weight codes are \(m\)-divisible, where \(m\) is the greatest common factor of their two possible weights.
  • Projective geometry code — There are several correpondences between projective and two-weight codes [2,6,8].
  • Weight-two code — Codewords of two-weight codes have one of two possible Hamming weights, while those of weight-two codes have Hamming weight two.


A. E. Brouwer, "Two-weight Codes." Concise Encyclopedia of Coding Theory (Chapman and Hall/CRC, 2021) DOI
R. Calderbank and W. M. Kantor, “The Geometry of Two-Weight Codes”, Bulletin of the London Mathematical Society 18, 97 (1986) DOI
A. Cossidente and O. H. King, “Some two-character sets”, Designs, Codes and Cryptography 56, 105 (2010) DOI
A. Cossidente and G. Marino, “Veronese embedding and two–character sets”, Designs, Codes and Cryptography 42, 103 (2006) DOI
I. Bouyukliev, M. Dzhumalieva-Stoeva, and V. Monev, “Classification of Binary Self-Dual Codes of Length 40”, IEEE Transactions on Information Theory 61, 4253 (2015) DOI
D. Jungnickel and V. D. Tonchev, “The classification of antipodal two-weight linear codes”, Finite Fields and Their Applications 50, 372 (2018) DOI
A. Barg et al., “On the size of maximal binary codes with 2, 3, and 4 distances”, (2022) arXiv:2210.07496
A. E. Brouwer and M. van Eupen, Designs, Codes and Cryptography 11, 261 (1997) DOI
Page edit log

Your contribution is welcome!

on (edit & pull request)

edit on this site

Zoo Code ID: two_weight

Cite as:
“Two-weight code”, The Error Correction Zoo (V. V. Albert & P. Faist, eds.), 2023.
  title={Two-weight code},
  booktitle={The Error Correction Zoo},
  editor={Albert, Victor V. and Faist, Philippe},
Share via:
Twitter | Mastodon |  | E-mail
Permanent link:

Cite as:

“Two-weight code”, The Error Correction Zoo (V. V. Albert & P. Faist, eds.), 2023.