Visual Tools
Calculators
Tables
Mathematical Keyboard
Converters
Other Tools


Dimension of Vector Space






The Number That Classifies a Vector Space

Every basis for a given vector space has the same number of elements. This number — the dimension — is the single most important invariant of the space. It governs how many vectors can be independent, how large a spanning set must be, how subspaces nest inside one another, and whether two spaces are structurally identical.



Definition

The dimension of a vector space VV, written dim(V)\dim(V), is the number of vectors in any basis for VV.

Dimension Definition
dim(V)=Bfor any basis B of V\dim(V) = |\mathcal{B}| \quad \text{for any basis } \mathcal{B} \text{ of } V
Learn more about this formula: Dimension Definition →


This definition relies on a nontrivial fact: all bases for VV have the same size. Without this guarantee, "the number of vectors in a basis" would depend on which basis was chosen, and the definition would be meaningless. The basis size theorem, proved in the next section, ensures that the count is intrinsic to the space itself.

By convention, the zero space {0}\{\mathbf{0}\} has dimension 00. Its only "basis" is the empty set, which contains no vectors, is vacuously independent, and spans {0}\{\mathbf{0}\} since the empty linear combination produces 0\mathbf{0}.
φabspan = ℝ²φabspan = line
Dimension two, then dimension one

The count of vectors is the same in both pictures; the dimension is not. Above, two independent directions give a two-dimensional span. Below, the second vector repeats the first, the span is a line, and the dimension has dropped to one. Dimension counts directions that survive independence, which is why it cannot be read off the size of a list. Collapse and restore it on the span and independence explorer.

Every result later on this page is a consequence of that one distinction between counting vectors and counting directions.

Dimension Notation

Notation

Dimension Notation

An operator whose value depends on something the notation usually hides — the field you are counting over — plus a symbol for "no finite count" that is a label rather than a number, and the relation that lets one integer stand in for an entire space. All catalogued among the linear algebra symbols.
B\mathcal{B} and the basis letters come from basis notation; B|\mathcal{B}| counting bars from cardinality notation; Col\operatorname{Col}, Nul\operatorname{Nul} and the rank–nullity dictionary from fundamental-space notation and image and kernel notation; F\mathbb{F} from span notation.
dim(V)\dim(V), dimF(V)\dim_{\mathbb{F}}(V)
the dimension of V — over the field F, when it matters
An upright operator taking a space and returning a count, defined as B|\mathcal{B}| for any basis, per Definition above. The parentheses are optional — dimV\dim V is equally standard — and the subscript names the field of scalars, which most writing omits because it is fixed by context.
CasesOmitting the subscript is safe until two fields are in play, and then it is essential: C\mathbb{C} has dimension 11 over C\mathbb{C} and dimension 22 over R\mathbb{R}, so dimC(C)=1\dim_{\mathbb{C}}(\mathbb{C}) = 1 while dimR(C)=2\dim_{\mathbb{R}}(\mathbb{C}) = 2. The space has not changed — only what counts as a scalar.
Do not confuseA property of the set. Dimension belongs to the space together with its field, not to the underlying collection of vectors; a bare dim\dim carries an unstated field, and two authors can write the same symbol for different numbers without either being wrong.
dim(V)=\dim(V) = \infty
V is infinite-dimensional
A label, not an arithmetic value: it records that no finite basis exists, which is the distinction Finite vs. Infinite Dimension below draws. The prose form "infinite-dimensional" is the more common spelling precisely because the equation invites reading \infty as a number.
CasesWhere the size genuinely matters, the count is replaced by a cardinal — the dimension of a space with a countably infinite basis is written 0\aleph_0 rather than \infty, borrowing cardinality notation; function spaces and polynomial spaces of unbounded degree are the usual inhabitants.
Do not confuseArithmetic. dim(V)=\dim(V) = \infty cannot be added or subtracted the way finite dimensions can — the subspace and rank–nullity formulas below all carry a silent finiteness assumption, and applying them across an infinite-dimensional space is where they quietly fail.
VWV \cong W
V is isomorphic to W
The wavy equals sign claims structural sameness rather than equality — the spaces may consist of entirely different objects. Dimension and Isomorphism below gives the classification it enables: over one field, VWV \cong W exactly when dim(V)=dim(W)\dim(V) = \dim(W), so a single integer determines the space up to \cong.
CasesEvery nn-dimensional space over F\mathbb{F} satisfies VFnV \cong \mathbb{F}^{n}, which is what licenses treating abstract spaces as coordinate space once a basis is chosen — the coordinate brackets are that isomorphism written down.
Same glyph elsewhere\cong marks congruence in geometry — same shape and size — and the two uses share only the idea of "the same in the ways that matter here"; a third relative, \equiv, means congruence modulo an integer.

The Basis Size Theorem

If a vector space VV has a basis with nn elements, then every basis for VV has exactly nn elements.

The proof rests on two supporting facts. First, in a space spanned by nn vectors, any set of more than nn vectors is dependent. Second, any spanning set contains at least as many vectors as any independent set.

Suppose B\mathcal{B} has nn elements and C\mathcal{C} has mm elements, and both are bases. Since B\mathcal{B} spans VV and C\mathcal{C} is independent, we get mnm \leq n. Since C\mathcal{C} spans VV and B\mathcal{B} is independent, we get nmn \leq m. Together, m=nm = n.

This theorem is what makes dimension well-defined. It converts a property of a particular basis (its size) into a property of the space itself.

Dimensions of Standard Spaces

The dimension of Rn\mathbb{R}^n is nn. The standard basis {e1,,en}\{\mathbf{e}_1, \dots, \mathbf{e}_n\} has nn elements, and any other basis for Rn\mathbb{R}^n also has exactly nn elements.

The matrix space Rm×n\mathbb{R}^{m \times n} has dimension mnmn. The standard basis consists of the mnmn matrix units EijE_{ij}, one for each entry position.

The polynomial space Pn\mathcal{P}_n has dimension n+1n + 1. The monomial basis {1,x,x2,,xn}\{1, x, x^2, \dots, x^n\} contains n+1n + 1 elements. Note the offset: the space of polynomials of degree at most 22 is three-dimensional, not two-dimensional, because the constant term counts as a basis direction.

The space P\mathcal{P} of all polynomials (no degree bound) is infinite-dimensional. For any proposed finite basis {p1,,pk}\{p_1, \dots, p_k\}, let NN be the maximum degree among them. Then xN+1x^{N+1} cannot be written as a combination of p1,,pkp_1, \dots, p_k, so the set does not span P\mathcal{P}.

The space C[a,b]C[a, b] of continuous functions on [a,b][a, b] is also infinite-dimensional, for similar reasons — no finite set of continuous functions can generate all others through linear combinations.
Vector spaces · dimension

Dimensions of the standard spaces

Each entry is a space, its dimension, and the basis that produces the count. The split is the point — the same definition gives a number for the first five and no number at all for the last two.

7spaces
Finite dimensional5
1
Coordinate space
basis {e1,,en}\{\mathbf{e}_1, \ldots, \mathbf{e}_n\}
dim(Rn)=n\dim(\mathbb{R}^n) = n
One standard basis vector per coordinate axis. The count is the number of independent directions, which for Rn\mathbb{R}^n is exactly the number of components — the case every other entry is measured against.
2
Matrix space
basis {Eij}\{E_{ij}\}, one per entry position
dim(Rm×n)=mn\dim(\mathbb{R}^{m \times n}) = mn
Each matrix unit EijE_{ij} has a single 11 and zeros elsewhere, so there is one basis element per slot. A 3×33 \times 3 matrix space has dimension 99, not 33 — the shape does not reduce the count.
3
Polynomials of bounded degree
basis {1,x,x2,,xn}\{1, x, x^2, \ldots, x^n\}
dim(Pn)=n+1\dim(\mathcal{P}_n) = n + 1
The constant term counts as a basis direction, so degree 2\leq 2 gives dimension 33, not 22. This off-by-one is the most common dimension error, and it comes from reading "degree nn" as the count rather than the top index.
4
Symmetric matrices
n×nn \times n, real, A=ATA = A^{\mathsf{T}}
dim=n(n+1)2\dim = \dfrac{n(n+1)}{2}
A subspace of Rn×n\mathbb{R}^{n \times n}: the symmetry condition ties each below-diagonal entry to its mirror, so only the diagonal and one triangle are free. Strictly smaller than n2n^2 for every n>1n > 1.
5
The zero space
basis is the empty set
dim({0})=0\dim(\{\mathbf{0}\}) = 0
Not dimension one. The zero vector is linearly dependent on its own, so it cannot belong to a basis — the empty set spans the zero space vacuously and is independent vacuously.
Infinite dimensional2
6
no finite basis exists
dim(P)=\dim(\mathcal{P}) = \infty
For any finite set with maximum degree NN, the polynomial xN+1x^{N+1} escapes its span — so no finite set can span, and the argument works whatever finite set is proposed.
7
dim(C[a,b])=\dim(C[a,b]) = \infty
No finite set of functions generates every continuous function by linear combination. Most of analysis lives here, which is why the finite-dimensional theory has to be stated as such rather than as the general case.
Dimension is a property of the space, not of any basis for it — that is the basis size theorem, and it is what makes the counts below well defined rather than an artefact of the basis chosen. The infinite-dimensional entries are not a failure of the definition; they are what the definition says when no finite set spans.
Dimensions of the standard spaces·/linear-algebra/vector-spaces/dimensionLearn Math Class

Finite vs. Infinite Dimension

A vector space is finite-dimensional if it has a finite basis, and infinite-dimensional otherwise.

In finite-dimensional spaces, the theory is clean and complete. Every independent set can be extended to a basis. Every spanning set can be reduced to one. The dimension is a finite integer that governs the entire structure of the space.

In infinite-dimensional spaces, the situation is more delicate. Bases still exist (assuming the axiom of choice), but they are called Hamel bases and are often unwieldy — a Hamel basis for C[0,1]C[0, 1] is uncountable and cannot be written down explicitly. In practice, infinite-dimensional spaces are handled with topological tools: Schauder bases (which allow infinite convergent sums), Hilbert space theory, and functional analysis.

On this site, all vector spaces are finite-dimensional unless explicitly stated otherwise. The finite-dimensional theory covers Rn\mathbb{R}^n, Pn\mathcal{P}_n, Rm×n\mathbb{R}^{m \times n}, and solution spaces of linear ODEs with constant coefficients — the spaces that appear in a standard linear algebra course.

Dimension and Independence

Dimension places hard constraints on how large an independent set can be:

Max Independent Set Size
S>dimVS is dependent|S| > \dim V \Rightarrow S \text{ is dependent}
Learn more about this formula: Max Independent Set Size →


This is the absolute ceiling: independence cannot survive past nn vectors, no matter how cleverly they are chosen. In R3\mathbb{R}^3, four or more vectors are always dependent. In P2\mathcal{P}_2, four or more polynomials are always dependent.

An independent set of exactly nn vectors is automatically a basis. Spanning comes for free once the count reaches the dimension. This is one of the most useful shortcuts in practice: to verify that nn vectors in an nn-dimensional space form a basis, it suffices to check independence alone.

An independent set of fewer than nn vectors can always be extended to a basis by adding nkn - k more vectors, where kk is the current count. The extension is not unique — there are many ways to complete the set — but the final count is always nn.

Dimension and Spanning

Dimension also constrains spanning sets from the other direction.

In an nn-dimensional space, any set of fewer than nn vectors cannot span the space. The span has dimension at most k<nk < n, so it is a proper subspace — some vectors in VV are unreachable. In R3\mathbb{R}^3, two vectors can span at most a plane, never all of R3\mathbb{R}^3.

A spanning set of exactly nn vectors is automatically a basis. Independence comes for free once the count hits the dimension. This is the mirror image of the independence shortcut: to verify that nn vectors span an nn-dimensional space, it suffices to check spanning alone, and independence follows.

A spanning set of more than nn vectors contains redundancies. At least knk - n vectors can be removed without shrinking the span. Removing all redundant vectors produces a basis.

These two shortcuts — "nn independent vectors in an nn-dimensional space form a basis" and "nn spanning vectors in an nn-dimensional space form a basis" — are the workhorses of basis verification.

Dimension of Subspaces

If WW is a subspace of a finite-dimensional space VV, then

Subspace Dimension Inequality
WVdim(W)dim(V),with equality    W=VW \subseteq V \Rightarrow \dim(W) \leq \dim(V), \quad \text{with equality} \iff W = V
Learn more about this formula: Subspace Dimension Inequality →


The inequality is strict (dim(W)<dim(V)\dim(W) < \dim(V)) for every proper subspace — a subspace that is not all of VV. The only subspace with dim(W)=dim(V)\dim(W) = \dim(V) is W=VW = V itself. This follows because any basis for WW is an independent set in VV with dim(W)\dim(W) elements, and extending it to a basis for VV adds dim(V)dim(W)\dim(V) - \dim(W) vectors. If no vectors need adding, WW already has a basis for all of VV.

In R3\mathbb{R}^3, the possible subspace dimensions are 00 (the zero vector), 11 (a line through the origin), 22 (a plane through the origin), and 33 (R3\mathbb{R}^3 itself). There is no subspace of dimension 32\frac{3}{2} or π\pi — dimension is always a non-negative integer.

For a matrix AA, the column space is a subspace of Rm\mathbb{R}^m with dimension equal to the rank, and the null space is a subspace of Rn\mathbb{R}^n with dimension nrank(A)n - \text{rank}(A). Both dimensions are bounded by the dimensions of their ambient spaces.

The Dimension Formula for Subspace Sums

For two subspaces W1W_1 and W2W_2 of a finite-dimensional space VV, the dimension of their sum satisfies

Dimension Sum Formula
dim(W1+W2)=dim(W1)+dim(W2)dim(W1W2)\dim(W_1 + W_2) = \dim(W_1) + \dim(W_2) - \dim(W_1 \cap W_2)
Learn more about this formula: Dimension Sum Formula →


This is the linear algebra analogue of the inclusion-exclusion formula for counting elements in the union of two sets. The intersection is subtracted because vectors in W1W2W_1 \cap W_2 are counted once in dim(W1)\dim(W_1) and once in dim(W2)\dim(W_2), but should only contribute once to the dimension of the sum.

A sum is called a direct sum, written W1W2W_1 \oplus W_2, precisely when the two subspaces meet only at the origin:

Direct Sum Criterion
V=W1W2    V=W1+W2 and W1W2={0}V = W_1 \oplus W_2 \iff V = W_1 + W_2 \text{ and } W_1 \cap W_2 = \{\mathbf{0}\}
Learn more about this formula: Direct Sum Criterion →


Every vector in a direct sum has a unique decomposition as w1+w2\mathbf{w}_1 + \mathbf{w}_2 with w1W1\mathbf{w}_1 \in W_1 and w2W2\mathbf{w}_2 \in W_2. For direct sums, the dimension formula collapses to plain addition:

Direct Sum Dimension
V=W1W2dim(V)=dim(W1)+dim(W2)V = W_1 \oplus W_2 \Rightarrow \dim(V) = \dim(W_1) + \dim(W_2)
Learn more about this formula: Direct Sum Dimension →


For example, in R3\mathbb{R}^3, let W1W_1 be the xyxy-plane (dimension 22) and W2W_2 be the zz-axis (dimension 11). Their intersection is {0}\{\mathbf{0}\}, so dim(W1+W2)=2+10=3\dim(W_1 + W_2) = 2 + 1 - 0 = 3. The sum is all of R3\mathbb{R}^3, and the decomposition R3=W1W2\mathbb{R}^3 = W_1 \oplus W_2 splits every vector into its xyxy-component and its zz-component.
Vector spaces · subspace sums

Sum and direct sum

One construction with one condition attached. Whether the intersection is trivial decides the dimension formula, the uniqueness of decompositions, and whether the notation \oplus is permitted at all.

2cases
The general case1
Sum§ 8W1+W2={w1+w2}W_1 + W_2 = \{\mathbf{w}_1 + \mathbf{w}_2\}
dimensiondimW1+dimW2dim(W1W2)\dim W_1 + \dim W_2 - \dim(W_1 \cap W_2)
intersectionmay be nontrivial
decompositionexists, but not unique
The correction term is a double count: anything in both subspaces is added twice and must be removed once. Two planes through the origin in R3\mathbb{R}^3 have dimensions summing to four in a three-dimensional space — the intersection line is the missing one.
When the intersection is trivial1
Direct sum§ 8W1W2={0}W_1 \cap W_2 = \{\mathbf{0}\}
dimensiondimW1+dimW2\dim W_1 + \dim W_2
intersectiontrivial — the origin only
decompositionexists and is unique
With nothing shared there is nothing to subtract, and each vector splits in exactly one way. This is the structure behind orthogonal complements and behind every basis: VV is the direct sum of the lines spanned by its basis vectors.
The direct sum is not a different operation — it is the general sum with W1W2={0}W_1 \cap W_2 = \{\mathbf{0}\}, at which point the correction term vanishes and every decomposition becomes unique. The two rows differ in one hypothesis and everything else follows from it.
Sum and direct sum·/linear-algebra/vector-spaces/dimensionLearn Math Class
The uniqueness column is the one that matters, and it is easy to read past. In a general sum a vector can usually be written as w1+w2\mathbf{w}_1 + \mathbf{w}_2 in many ways — shift any element of the intersection from one part to the other and the sum is unchanged. A trivial intersection removes that freedom entirely, which is why the direct sum is the condition under which a decomposition can be spoken of as the decomposition.

The Rank-Nullity Theorem as a Dimension Statement

For an m×nm \times n matrix AA, the rank-nullity theorem states

Rank-Nullity Theorem (Matrix Form)
dim(ColA)+dim(NullA)=n\dim(\text{Col}\,A) + \dim(\text{Null}\,A) = n
Learn more about this formula: Rank-Nullity Theorem (Matrix Form) →


The column space is a subspace of Rm\mathbb{R}^m with dimension rank(A)\text{rank}(A). The null space is a subspace of Rn\mathbb{R}^n with dimension nrank(A)n - \text{rank}(A). Their dimensions add up to nn, the dimension of the domain Rn\mathbb{R}^n.

Interpreted through the lens of linear transformations, this says that the nn dimensions of the domain split between the image (what the map hits) and the kernel (what the map kills). No dimensions are lost or created — they are redistributed.

The rank-nullity theorem is the fundamental bridge between abstract dimension theory and concrete matrix computation. It connects the number of pivot columns (rank) to the number of free variables (nullity), and it guarantees that every question about the dimension of a null space or column space reduces to row reduction and pivot counting.
A3×3121243364basis of C(A)3×2112334R3×3120001000A3×3121243364basis of N(A)3×12−10=03×1000
Pivot columns above, free-column solutions below

Every column of the matrix is either a pivot column, contributing a dimension to the column space, or a free column, contributing a dimension to the null space. No column can be both and none is left out, which is the whole content of the rank-nullity theorem: the two dimensions are partitioning the same finite supply. See the accounting for all four spaces on the four fundamental subspaces visualizer.

Read this way the theorem is bookkeeping rather than a surprise: the columns were always going to be divided between the two spaces.

Dimension and Isomorphism

Two finite-dimensional vector spaces over the same field are isomorphic — structurally identical as vector spaces — if and only if they have the same dimension.

The forward direction is straightforward: an isomorphism maps a basis to a basis, preserving the count. The reverse direction is the deeper fact: given any two nn-dimensional spaces VV and WW, choosing a basis for each creates coordinate maps VRnV \to \mathbb{R}^n and WRnW \to \mathbb{R}^n. Composing one with the inverse of the other gives a direct isomorphism VWV \to W.

This means dimension is the single complete invariant for finite-dimensional vector spaces. It captures everything about the linear-algebraic structure — independence, span, basis size, subspace behavior — in a single integer. Two spaces with the same dimension may contain very different objects (polynomials vs. matrices vs. functions), but from the perspective of linear algebra, they are indistinguishable.

R3\mathbb{R}^3, P2\mathcal{P}_2, and the solution space of a third-order homogeneous linear ODE are all three-dimensional. They are isomorphic as vector spaces. Every theorem that holds in one holds in all three — that is the payoff of the axiomatic approach.

Summary: Count vs. Dimension

In an nn-dimensional space, the relationship between a set's size kk and the dimension nn controls what the set can be. Sets smaller than nn can be independent but never span; sets larger than nn can span but are never independent; and at exactly nn, the two notions collapse — either independence or spanning alone implies the other, making the set a basis. The table below collects these three regimes side by side, organizing the entire interaction of count and dimension into a single reference card.
k vectors in an n-dimensional space Can be independent? Can span? Can be a basis?
k < n (too few) possible — the set can always be extended to a basis by adding n − k vectors impossible — the span is a proper subspace of dimension ≤ k impossible — cannot span
k = n (the boundary) iff the set is independent iff the set spans independence and spanning collapse — either condition alone implies the other, and the set is a basis
k > n (too many) impossible — the set is automatically dependent possible if the set contains n independent vectors impossible — always has redundancy; k − n vectors can be removed

Dimension FAQ

Does C\mathbb{C} have dimension 11 or 22?

+
Both, depending on the field of scalars, and neither answer is wrong. Over C\mathbb{C} a single basis vector suffices, so the dimension is 11; over R\mathbb{R} you need two, giving dimR(C)=2\dim_{\mathbb{R}}(\mathbb{C}) = 2. The space has not changed, only what counts as a scalar. Dimension belongs to a space together with its field.Read more →

Can you do arithmetic with dim(V)=\dim(V) = \infty?

+
No, and this is where the standard formulas quietly fail. Results like the subspace dimension formula and rank-nullity all carry an unstated finiteness assumption, so subtracting infinities produces nonsense. Where the size genuinely matters, a cardinal replaces the symbol: a countably infinite basis gives dimension 0\aleph_0, not \infty.Read more →

Why can any nn-dimensional space be treated as Rn\mathbb{R}^n?

+
Because every nn-dimensional space over F\mathbb{F} is isomorphic to Fn\mathbb{F}^n, so once a basis is fixed the two are interchangeable for computation. Choosing the basis is what supplies the translation, and coordinate vectors are that isomorphism written down. Without a chosen basis the correspondence exists but has no concrete form.Read more →