Vector Normalization
L2-normalize a vector to unit length.
About this tool
Enter a vector and get it scaled to length 1 by dividing every component by the L2 norm. (3, 4) has norm 5, so it becomes (0.6, 0.8). Normalised vectors let a dot product equal cosine similarity.
How to use
How it works
v̂ = v / ‖v‖₂. The direction is unchanged and the length becomes 1. Vector databases often store normalised embeddings so that inner product search gives the same ranking as cosine similarity.
v̂ = v / ‖v‖₂
Worked example
The 3-4-5 vector
- Input
- 3, 4
- Output
- 0.6, 0.8 (original norm 5, new norm 1)
- Walkthrough
- √(3² + 4²) = 5, then 3/5 = 0.6 and 4/5 = 0.8.
Limitations
- A zero vector cannot be normalised.
- L2 normalisation only; no L1 or max normalisation.
- Output is rounded to six decimals.
Questions
How do I normalize a vector?
Why normalise embeddings?
What is a unit vector?
Does normalising change direction?
Features
- L2 normalization
- Before and after norms
- Runs in your browser
Related resources
Guides and videos from around the web—opens on YouTube or the publisher’s site.
TensorFlow 2.0 Complete Course
freeCodeCamp.org
Practical ML stack context next to AI utilities.
Watch on YouTubeMachine Learning for Everybody
freeCodeCamp.org
Accessible ML survey for AI calculator and metric tools.
Watch on YouTube
- Machine Learning Crash Course
Google Developers
Official ML crash course pairing with metric calculators.
- DeepLearning.AI
DeepLearning.AI
Courses and explainers for modern AI tooling.