Every $A\in\mathbb C^{m\times n}$ has a singular value decomposition
$$A=U\Sigma V^*,$$
where $U,V$ are square unitary matrices and $\Sigma$ is rectangular diagonal with $p=\min(m,n)$ nonnegative singular values in descending order. For real $A$, the factors may be chosen real orthogonal.

The nonzero singular values are square roots of the nonzero eigenvalues of $A^*A$ or $AA^*$. Those two square matrices can have **different numbers of additional zeros**. Rank is the number of positive singular values.

If $r=\operatorname{rank}A$, the compact SVD is $A=U_r\Sigma_rV_r^*$. It yields $A^+=V_r\Sigma_r^{-1}U_r^*$ and reveals bases for range and null spaces. For $0\le k<r$, keeping the largest $k$ singular values gives a best rank-at-most-$k$ approximation; its 2-norm error is $\sigma_{k+1}$.

For centered data matrices, right singular vectors provide principal directions for PCA. See [numerical methods](https://knowen.md/nodes/37115) for choosing SVD versus QR or LU.