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

# ST_IsValid

> Tests the topology validity of a native GEOGRAPHY or GEOMETRY value.

Returns whether a structurally readable native GEO value is topologically valid. It never repairs or rewrites the input.

## Syntax

```sql theme={null}
BOOLEAN ST_IsValid(GEOGRAPHY value)
BOOLEAN ST_IsValid(GEOMETRY value)
```

All seven XY OGC families are supported, including `MULTI*` and `GEOMETRYCOLLECTION`. `GEOMETRY` uses robust planar topology checks. `GEOGRAPHY` validates longitude/latitude, great-circle lines, spherical polygon loops and holes, and rejects multipolygon components with overlapping interiors. Its result can differ from planar validity for the same coordinates.

A topology-invalid but readable value returns `false`. `EMPTY` values return `true`, and SQL `NULL` produces `NULL`. Malformed WKB, unsupported dimensions, and invalid or unsupported descriptors produce a controlled error rather than `false`.

## Examples

```SQL theme={null}
SELECT ST_IsValid(ST_GeomFromText(
    'POLYGON ((0 0, 2 2, 0 2, 2 0, 0 0))', 'EPSG:3857'));
-- false: the ring self-intersects

SELECT ST_IsValid(ST_GeogFromText('POLYGON ((0 0, 2 0, 2 2, 0 2, 0 0))'));
-- true
```

## Keywords

ST\_ISVALID,ST,ISVALID,VALID,GEOGRAPHY,GEOMETRY

## 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.