In algebraic number theory, a quadratic field is an algebraic number field K of degree two over Q. It is easy to show that the map d ↦ Q(√d) is a bijection from the set of all square-free integers d ≠ 0, 1 to the set of all quadratic fields. If d > 0 the corresponding quadratic field is called a real quadratic field, and for d < 0 an imaginary quadratic field or complex quadratic field, corresponding to whether its archimedean embeddings are real or complex.
 Ring of integers
The discriminant of the quadratic field Q(√d) is d if d is congruent to 1 modulo 4, and otherwise 4d. For example, when d is −1 so that K is the field of so-called Gaussian rationals, the discriminant is −4. The reason for this distinction relates to general algebraic number theory. The ring of integers of K is spanned by 1 and the square root of d only in the second case, and in the first case there are such integers that lie at half the 'lattice points' (for example, when d = −3, these are the Eisenstein integers, given by the complex cube roots of unity).
The set of discriminants of quadratic fields is exactly the set of fundamental discriminants.
 Prime factorization into ideals
- p is inert
- (p) is a prime ideal
- The quotient ring is the finite field with p2 elements: OK/pOK = Fp2
- p splits
- (p) is a product of two distinct prime ideals of OK.
- The quotient ring is the product OK/pOK = Fp × Fp.
- p is ramified
- (p) is the square of a prime ideal of OK.
- The quotient ring contains non-zero nilpotent elements.
The third case happens if and only if p divides the discriminant D. The first and second cases occur when the Kronecker symbol (D/p) equals −1 and +1, respectively. For example, if p is an odd prime not dividing D, then p splits if and only if D is congruent to a square modulo p. The first two cases are in a certain sense equally likely to occur as p runs through the primes, see Chebotarev density theorem.
The law of quadratic reciprocity implies that the splitting behaviour of a prime p in a quadratic field depends only on p modulo D, where D is the field discriminant.
 Quadratic subfields of cyclotomic fields
 The quadratic subfield of the prime cyclotomic field
A classical example of the construction of a quadratic field is to take the unique quadratic field inside the cyclotomic field generated by a primitive p-th root of unity, with p a prime number > 2. The uniqueness is a consequence of Galois theory, there being a unique subgroup of index 2 in the Galois group over Q. As explained at Gaussian period, the discriminant of the quadratic field is p for p = 4n + 1 and −p for p = 4n + 3. This can also be predicted from enough ramification theory. In fact p is the only prime that ramifies in the cyclotomic field, so that p is the only prime that can divide the quadratic field discriminant. That rules out the 'other' discriminants −4p and 4p in the respective cases.
 Other cyclotomic fields
If one takes the other cyclotomic fields, they have Galois groups with extra 2-torsion, and so contain at least three quadratic fields. In general a quadratic field of field discriminant D can be obtained as a subfield of a cyclotomic field of D-th roots of unity. This expresses the fact that the conductor of a quadratic field is the absolute value of its discriminant.
 See also
- Samuel, pp. 76–77
- Duncan Buell (1989). Binary quadratic forms: classical theory and modern computations. Springer-Verlag. ISBN 0-387-97037-1. Chapter 6.
- Pierre Samuel (1972). Algebraic number theory. Hermann/Kershaw.
- I.N. Stewart; D.O. Tall (1979). Algebraic number theory. Chapman and Hall. ISBN 0-412-13840-9. Chapter 3.1.