A basis for a topological space (X, τ) is a collection B of open sets such that every open set in τ is a union of members of B. A basis provides a generating set for the topology: instead of specifying all open sets directly, one specifies a smaller collection from which the rest are built by taking unions.

A collection B of subsets of X is a basis for some topology if: (1) every point of X belongs to some member of B, and (2) if a point belongs to B₁ ∩ B₂ for two basis elements, then some basis element B₃ contains the point and is contained in the intersection. The topology generated by B is then the collection of all unions of members of B.

In a metric space, the open balls form a basis — every open set is a union of open balls. In ℝⁿ, the open boxes with rational endpoints form a countable basis, making ℝⁿ second-countable. The existence of a countable basis is a separability condition that ensures the topology is not too large.

A basis for a topology on a category of open sets generates the Grothendieck topology used to define sheaves. The notion of basis transfers from point-set topology to the categorical setting through sites and covers: a covering family generates the same sheaf condition that the full topology would.