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

# ST_Within

> Tests whether a point is strictly within a polygon.

Returns whether a point is in the interior of a polygon. This is the converse of `ST_Contains` and excludes exterior and hole boundaries.

## Syntax

```sql theme={null}
BOOLEAN ST_Within(GEOGRAPHY point, GEOGRAPHY polygon)
BOOLEAN ST_Within(GEOMETRY point, GEOMETRY polygon)
```

`polygon` must be an XY `POLYGON` or `MULTIPOLYGON`, and `point` must be an XY `POINT`. `GEOMETRY` descriptors must match. `NULL` propagates, and an `EMPTY` input returns `false`.

## Example

```SQL theme={null}
SELECT ST_Within(
    ST_GeomFromText('POINT (5 5)', 'EPSG:3857'),
    ST_GeomFromText('POLYGON ((0 0, 10 0, 10 10, 0 10, 0 0))', 'EPSG:3857'));
-- true
```

## Keywords

ST\_WITHIN,ST,WITHIN

## Related data types

[GEOGRAPHY](/documents/4.2/sql-reference/data-types/spatial-types/GEOGRAPHY.md), [GEOMETRY](/documents/4.2/sql-reference/data-types/spatial-types/GEOMETRY.md), [BOOLEAN](/documents/4.2/sql-reference/data-types/numeric/BOOLEAN.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.