# Euclidean Distance

- **Canonical URL:** https://getaimath.com/dictionary/euclidean-distance/
- **Topics:** [Context, Memory & Retrieval](https://getaimath.com/dictionary/category/context-memory-and-retrieval/)
- **Last updated:** 2026-11-25

## What is Euclidean Distance?

**In one sentence:** Euclidean distance is the straight-line distance between two points or vectors.

It is like measuring with a ruler between two dots on a map, but in many dimensions. A smaller distance means more similar items.

![Context Window vs. Memory: Your Desk vs. The Filing Cabinet — Simple cartoon comparing the AI Context Window (a small desk that can only fit a few pages right now) with External Memory & Search (a big filing cabinet where a librarian grabs just the 3 pages you need).](https://getaimath.com/diagrams/context-memory-and-retrieval.png)
*Napkin Diagram (Context, Memory & Retrieval): The context window is the small desk the AI can see right now; search grabs the right pages from the filing cabinet.*

## What is an example of Euclidean Distance?

Two points at (0, 0) and (3, 4) are 5 units apart in Euclidean distance.

## Why does Euclidean Distance matter?

It is another common way to measure similarity in vector search.

## Related Concepts

- [Cosine Similarity](https://getaimath.com/dictionary/cosine-similarity/): Cosine similarity measures how similar two vectors are by checking the angle between them.
- [Approximate Nearest Neighbors (ANN)](https://getaimath.com/dictionary/approximate-nearest-neighbors-ann/): Approximate nearest neighbors finds results that are almost certainly the closest matches, much faster than checking every item.
- [Similarity Search](https://getaimath.com/dictionary/similarity-search/): Similarity search finds items that are most like a given item, using a measure of closeness.
- [HNSW](https://getaimath.com/dictionary/hnsw/): HNSW, or Hierarchical Navigable Small World, is a popular ANN method that organizes vectors into layered networks for fast searching.
- [Dimensions](https://getaimath.com/dictionary/dimensions/): Dimensions are the number of values in a vector, like the number of directions it can point in.
- [FAISS](https://getaimath.com/dictionary/faiss/): FAISS is a free library from Meta for fast similarity search and clustering of vectors.

---
Source: The AI Math Dictionary (https://getaimath.com/dictionary/euclidean-distance/)
