Back to Home
Embeddings & Search
Vector Normalization
Normalization changes a vector so its size becomes consistent while keeping its direction the same.
This is a learning demo using simple vectors. Real AI systems normalize high-dimensional embeddings before comparing them.
Interactive Playground
Original Vector
Vector:
[ 20, 45, 60, 80 ]
Similarity Demo
Compare two vectors. Cosine similarity mostly depends on direction, not size.
Vector A
Vector B
Raw Vectors
Cosine Sim
After Normalize
Cosine Sim
💡
Cosine similarity is nearly identical before and after normalization because it already measures direction.
Live Visualization
Original Vector
[ 20, 45, 60, 80 ]
Normalized Vector
[ ]
Vector Length
110.23
Original Length
→
1.00
Normalized Length
Normalization always makes the length equal to 1.0
Bar Comparison
Original
Normalized
Direction Visualization
Both arrows point the same direction. Only the length changes.
Original
Normalized
Statistics
Original Length
1.00
Normalized Length
4
Dimensions
Max Value
Min Value
Cosine Similarity
The Formula
v̂ = v ÷ |v|
where |v| = √(x² + y² + z² + …)
1
Calculate magnitude, square each value, sum them, take the square root.
2
Divide each value by that magnitude.
✓
Result, a unit vector with length exactly 1. Now you can compare angles fairly.
🎓
Tips
2 tips
Without normalization, longer documents score higher just because they're bigger, normalization removes that length bias.
After normalizing, dot product = cosine similarity. Most fast vector search libraries assume normalized vectors for this reason.
💡
Key Takeaway
Normalization keeps the direction of a vector the same while making its length consistent. This helps AI compare vectors more fairly.