> ## Documentation Index
> Fetch the complete documentation index at: https://docs.firebolt.io/llms.txt
> Use this file to discover all available pages before exploring further.

<AgentInstructions>

## Submitting Feedback

If you encounter incorrect, outdated, or confusing documentation on this page, submit feedback:

POST https://docs.firebolt.io/feedback

```json
{
  "path": "/reference-sql/functions-reference/vector/vector-euclidean-distance",
  "feedback": "Description of the issue"
}
```

Only submit feedback when you have something specific and actionable to report.

</AgentInstructions>

> Reference material for VECTOR_EUCLIDEAN_DISTANCE function

# VECTOR_EUCLIDEAN_DISTANCE

## VECTOR\_EUCLIDEAN\_DISTANCE

Returns the Euclidean distance, or L2 distance, between two vectors. The Euclidean distance measures the shortest distance between two points in space along a straight line. It is calculated by summing the squared distances of a pair of vector elements, and then taking the square root.

**Alias:** `l2_distance` (aligned with pgvector for compatibility)

## Syntax

```sql theme={"theme":{"light":"github-light","dark":"github-dark"}}
VECTOR_EUCLIDEAN_DISTANCE(<array>, <array>)
```

## Parameters

| Parameter | Description                                        | Supported input types                                                 |
| :-------- | :------------------------------------------------- | :-------------------------------------------------------------------- |
| `<array>` | The first array used in the distance calculation.  | Any array of [numeric data types](/reference-sql/data-types#numeric). |
| `<array>` | The second array used in the distance calculation. | Any array of [numeric data types](/reference-sql/data-types#numeric). |

## Notes

Both input `array` arguments must have the same number of elements.

## Return Type

`DOUBLE`

## Examples

**Example**

The following code returns the Euclidean distance between two vectors:

```sql theme={"theme":{"light":"github-light","dark":"github-dark"}}
SELECT VECTOR_EUCLIDEAN_DISTANCE([1, 2], [3, 4]) AS distance;
```

**Returns**

| distance (DOUBLE PRECISION) |
| :-------------------------- |
| 2.8284271247461903          |
