Finite Field GF(2ⁿ) Calculator
Add and multiply binary polynomials modulo an irreducible polynomial. This educational calculator shows the formula, result, and step-by-step interpretation.
Calculator
What this calculator teaches
Finite fields GF(2ⁿ) are used in AES, CRCs, coding theory, and binary algebra.
Use the result as a learning aid. For classwork, still show the formula and intermediate reasoning so the final answer is not just a black-box number.
Binary Polynomial Arithmetic in GF(2ⁿ)
Elements of GF(2ⁿ) can be represented as binary polynomials whose coefficients are in GF(2). A bit string such as 1011 represents x³+x+1. Because coefficients are only 0 or 1, addition and subtraction are the same operation: coefficientwise XOR with no carries.
Multiplication first forms the ordinary polynomial product over GF(2), again using XOR when like powers combine. The raw product is then reduced modulo a chosen degree-n irreducible polynomial. This reduction keeps the result degree below n and is what turns the n-bit representations into a field rather than merely a polynomial ring.
| Operation | Binary-polynomial rule |
|---|---|
| Add | a+b = a XOR b |
| Multiply | polynomial product over GF(2) |
| Reduce | product mod p(x) |
For a true GF(2ⁿ), the modulus polynomial must be irreducible over GF(2). If a reducible polynomial is used, nonzero elements may fail to have multiplicative inverses, so the resulting arithmetic is not a field.
Degree gives an immediate range check. With a degree-n modulus, every reduced field element should have polynomial degree below n, so it fits in at most n bits. If a multiplication result still contains an xⁿ term or higher, polynomial reduction is incomplete.
Do not confuse polynomial bits with the binary representation of ordinary integer multiplication. For instance, in GF(2), x·x is x² and coefficients combine by XOR, not by carrying. The same bit patterns can therefore produce different multiplication results from normal integers. This distinction is central to AES arithmetic, Reed–Solomon-style coding ideas, and other binary-field applications. Always state the modulus polynomial when reporting a multiplication result because the same raw product can reduce differently in different fields.
Formula & Symbols
| Concept | Formula or rule |
|---|---|
| Addition in GF(2) | XOR coefficients |
| Multiplication | polynomial product reduced modulo p(x) |
Worked example
Common mistakes
Keep lists comma separated, matrices as rows separated by semicolons, and modular inputs as integers.
Some methods require positive probabilities, valid moduli, independent trials, or small educational input sizes.
Finite-field polynomial addition uses XOR. There are no carries between bit positions.
The modulus must be irreducible of the intended degree for GF(2ⁿ) field arithmetic.
Small hand-worked XOR examples are especially useful for checking polynomial bit order before trusting a larger calculation.
FAQ
Related calculators
These links will work after the calculators are registered in the final Math layout update.
Formula Explorer connections
Interpretation: This formula uses integer divisibility, modular arithmetic, finite fields or coding relationships. Assumption: Inputs are usually integers with specific modulus or coprimality requirements. Cryptographic examples are educational and not a substitute for vetted security libraries.