Vector Distance Calculator
Compute distance and angle between any two n-dimensional vectors.
Euclidean vector distance
Enter two vectors (up to 6 dimensions)
Vector a
Vector b
What is vector distance?
A vector is an ordered tuple of numbers — a list of coordinates in n-dimensional space — and 'distance' between two vectors quantifies how dissimilar those two tuples are. Different definitions of distance measure dissimilarity in different ways: Euclidean distance captures the straight-line gap in space, Manhattan distance captures the sum of axis-aligned steps, Chebyshev distance captures the largest single-axis gap, and cosine similarity captures angular alignment regardless of magnitude.
Vector distances are core building blocks in machine learning (k-nearest-neighbour, k-means clustering, embedding-based search), recommender systems, document retrieval (cosine similarity on TF-IDF or embedding vectors), computer vision (image-feature matching), bioinformatics (sequence-feature comparison), and dozens of other fields. Picking the right metric for your data — symmetric vs asymmetric, magnitude-sensitive vs direction-only — is often more important than tuning the algorithm itself.
How the vector calculator works
Enter both vectors
Type the components of vectors a and b. The calculator supports up to 6 dimensions and treats missing components as 0.
Read every metric
Euclidean, Manhattan, Chebyshev, Minkowski-3, cosine similarity, cosine distance, dot product, and the angle between the vectors — all reported simultaneously.
Inspect the classification
A one-word verdict (Identical, Parallel, Orthogonal, Acute, Obtuse) summarises the angular relationship between the two vectors.
Step through the math
The step-by-step section shows how every metric was computed so you can use the panel as a teaching tool.
Formulas inside this tool
Euclidean (L₂)
d = √Σ(aᵢ − bᵢ)²
Straight-line distance in n-D — the default 'distance'.
Manhattan (L₁)
d₁ = Σ|aᵢ − bᵢ|
Sum of axis-aligned steps, like a taxi on a grid.
Chebyshev (L∞)
d∞ = max |aᵢ − bᵢ|
Largest single-axis gap — like a king on a chessboard.
Minkowski (Lₚ)
dₚ = (Σ|aᵢ − bᵢ|ᵖ)^(1/p)
Family of distances interpolating between L₁, L₂, and L∞.
Cosine similarity
cos θ = (a · b) / (‖a‖ ‖b‖)
Angular similarity ignoring magnitudes.
Cosine distance
d = 1 − cos θ
Bounded in [0, 2], 0 for identical direction, 1 for orthogonal.
Real-world uses
Recommender systems
Netflix-style recommendations compute cosine similarity between user-rating vectors to find users with the most similar taste.
Document search
Search engines and modern retrieval-augmented generation tools compare embedding vectors of query and document using cosine similarity.
k-Nearest-Neighbour classification
kNN classifiers identify the k closest training vectors in Euclidean (or other) distance and vote for a label.
Clustering
k-means assigns each point to the cluster whose centroid is closest in Euclidean distance, iteratively refining the partition.
Why use this calculator?
Picking the right distance metric for a data-science problem is mostly experience — and getting a quick comparison between Euclidean, Manhattan, Chebyshev, and cosine for a sample pair of vectors is the fastest way to build that experience. This tool lets you tinker with toy vectors and see how the metrics differ, before plugging the chosen one into a much larger pipeline.
Frequently Asked Questions
Related Calculators
More coordinate-geometry, trig, and unit tools that pair with distance calculations.
- Distance Calculator2D, 3D, lat/lng, map, vector, and geometry distance — six tools, step-by-step solutions, interactive visualisations.
- Pythagorean Theorem CalculatorSolve any side of a right triangle, plus area, perimeter, and angles.
- Slope CalculatorSlope, angle, distance, midpoint, intercepts, and the line equation with an interactive coordinate-plane graph.
- Triangle CalculatorSolve any triangle (SSS, SAS, ASA, AAS, SSA) for sides, angles, area, altitudes, medians, inradius, circumradius and centres.
- Circle CalculatorFind area, circumference, diameter, and radius from any one known value.
- Scientific CalculatorAdvanced trig, log, exponent, root, factorial, and memory functions.