In geometry, **ramification** is 'branching out', in the way that the square root function, for complex numbers, can be seen to have two *branches* differing in sign. The term is also used from the opposite perspective (branches coming together) as when a covering map degenerates at a point of a space, with some collapsing of the fibers of the mapping.

In complex analysis, the basic model can be taken as the *z* → *z*^{n} mapping in the complex plane, near *z* = 0. This is the standard local picture in Riemann surface theory, of ramification of order *n*. It occurs for example in the Riemann–Hurwitz formula for the effect of mappings on the genus. See also branch point.

In a covering map the Euler–Poincaré characteristic should multiply by the number of sheets; ramification can therefore be detected by some dropping from that. The *z* → *z*^{n} mapping shows this as a local pattern: if we exclude 0, looking at 0 < |*z*| < 1 say, we have (from the homotopy point of view) the circle mapped to itself by the *n*-th power map (Euler–Poincaré characteristic 0), but with the whole disk the Euler–Poincaré characteristic is 1, *n* – 1 being the 'lost' points as the *n* sheets come together at *z* = 0.

In geometric terms, ramification is something that happens in *codimension two* (like knot theory, and monodromy); since *real* codimension two is *complex* codimension one, the local complex example sets the pattern for higher-dimensional complex manifolds. In complex analysis, sheets can't simply fold over along a line (one variable), or codimension one subspace in the general case. The ramification set (branch locus on the base, double point set above) will be two real dimensions lower than the ambient manifold, and so will not separate it into two 'sides', locally―there will be paths that trace round the branch locus, just as in the example. In algebraic geometry over any field, by analogy, it also happens in algebraic codimension one.

Ramification in algebraic number theory means a prime ideal factoring in an extension so as to give some repeated prime ideal factors. Namely, let be the ring of integers of an algebraic number field , and a prime ideal of . For a field extension we can consider the ring of integers (which is the integral closure of in ), and the ideal of . This ideal may or may not be prime, but for finite , it has a factorization into prime ideals:

where the are distinct prime ideals of . Then is said to **ramify** in if for some ; otherwise it is **unramified**. In other words, ramifies in if the **ramification index** is greater than one for some . An equivalent condition is that has a non-zero nilpotent element: it is not a product of finite fields. The analogy with the Riemann surface case was already pointed out by Richard Dedekind and Heinrich M. Weber in the nineteenth century.

The ramification is encoded in by the relative discriminant and in by the relative different. The former is an ideal of and is divisible by if and only if some ideal of dividing is ramified. The latter is an ideal of and is divisible by the prime ideal of precisely when is ramified.

The ramification is **tame** when the ramification indices are all relatively prime to the residue characteristic *p* of , otherwise **wild**. This condition is important in Galois module theory. A finite generically étale extension of Dedekind domains is tame if and only if the trace is surjective.

Main article: Ramification of local fields |

The more detailed analysis of ramification in number fields can be carried out using extensions of the p-adic numbers, because it is a *local* question. In that case a quantitative measure of ramification is defined for Galois extensions, basically by asking how far the Galois group moves field elements with respect to the metric. A sequence of ramification groups is defined, reifying (amongst other things) *wild* (non-tame) ramification. This goes beyond the geometric analogue.

Main article: Ramification theory of valuations |

In valuation theory, the ramification theory of valuations studies the set of extensions of a valuation of a field *K* to an extension field of *K*. This generalizes the notions in algebraic number theory, local fields, and Dedekind domains.

There is also corresponding notion of unramified morphism in algebraic geometry. It serves to define étale morphisms.

Let be a morphism of schemes. The support of the quasicoherent sheaf is called the **ramification locus** of and the image of the ramification locus, , is called the **branch locus** of . If we say that is **formally unramified** and if is also of locally finite presentation we say that is **unramified** (see Vakil 2017).