> This page location: Math Functions > DEGREES
> Full Neon documentation index: https://neon.com/docs/llms.txt

# PostgreSQL DEGREES() Function

**Summary**: in this tutorial, you will learn how to use the PostgreSQL `DEGREES()` function to convert radians to degrees.

## Introduction to the PostgreSQL DEGREES() function

The `DEGREES()` function converts radians to degrees. Here's the syntax of the `DEGREES()` function:

```sql
DEGREES(radians_value)
```

In this syntax, the `radians_value` is a value in radians that you want to convert to degrees.

The `DEGREES()` function returns the value of the `radians_value` in degrees.

If the `radians_value` is `NULL`, the `DEGREES()` function returns `NULL`.

## PostgreSQL DEGREES() function examples

Let's take some examples of using the `DEGREES()` function.

### 1) Basic DEGREES() function examples

The following example uses the `DEGREES()` function to convert 1 radian to its equivalent degrees:

```sql
SELECT DEGREES(1);
```

Output:

```text
      degrees
-------------------
 57.29577951308232
(1 row)
```

The following example uses the `DEGREES()` function to convert the value of π (pi) radians to its equivalent in degrees:

```sql
SELECT DEGREES(PI());
```

Output:

```text
 degrees
---------
     180
(1 row)
```

Note that the `PI()` function returns the value of π (pi) radians.

### 2) Using the DEGREES() function with table data

First, [create a new table](../postgresql-tutorial/postgresql-create-table) called `angles` to store radian data:

```sql
CREATE TABLE angles (
    id SERIAL PRIMARY KEY,
    angle_radians NUMERIC
);
```

Second, [insert some rows](../postgresql-tutorial/postgresql-insert) into the `angles` table:

```sql
INSERT INTO angles (angle_radians)
VALUES
    (2*PI()),
    (PI()),
    (PI()/2),
    (NULL)
RETURNING *;
```

Third, use the `DEGREES()` function to convert radians to degrees:

```sql
SELECT
    id,
    angle_radians,
    ROUND(DEGREES(angle_radians)::numeric, 0) AS angle_degrees
FROM
    angles;
```

Output:

```text
 id |  angle_radians   | angle_degrees
----+------------------+---------------
  1 | 6.28318530717959 |           360
  2 | 3.14159265358979 |           180
  3 |  1.5707963267949 |            90
  4 |             null |          null
(4 rows)
```

## Summary

- Use the PostgreSQL `DEGREES()` function to convert radians to degrees.

---

## Related docs (Math Functions)

- [ABS](https://neon.com/postgresql/postgresql-math-functions/postgresql-abs)
- [CBRT](https://neon.com/postgresql/postgresql-math-functions/postgresql-cbrt)
- [CEIL](https://neon.com/postgresql/postgresql-math-functions/postgresql-ceil)
- [DIV](https://neon.com/postgresql/postgresql-math-functions/postgresql-div)
- [EXP](https://neon.com/postgresql/postgresql-math-functions/postgresql-exp)
- [FACTORIAL](https://neon.com/postgresql/postgresql-math-functions/postgresql-factorial)
- [FLOOR](https://neon.com/postgresql/postgresql-math-functions/postgresql-floor)
- [GCD](https://neon.com/postgresql/postgresql-math-functions/postgresql-gcd)
- [LCM](https://neon.com/postgresql/postgresql-math-functions/postgresql-lcm)
- [LN](https://neon.com/postgresql/postgresql-math-functions/postgresql-ln)
- [LOG](https://neon.com/postgresql/postgresql-math-functions/postgresql-log)
- [MOD](https://neon.com/postgresql/postgresql-math-functions/postgresql-mod)
- [MIN_SCALE](https://neon.com/postgresql/postgresql-math-functions/postgresql-min_scale)
- [PI](https://neon.com/postgresql/postgresql-math-functions/postgresql-pi-function)
- [POWER](https://neon.com/postgresql/postgresql-math-functions/postgresql-power)
- [RADIANS](https://neon.com/postgresql/postgresql-math-functions/postgresql-radians)
- [RANDOM](https://neon.com/postgresql/postgresql-math-functions/postgresql-random)
- [ROUND](https://neon.com/postgresql/postgresql-math-functions/postgresql-round)
- [SCALE](https://neon.com/postgresql/postgresql-math-functions/postgresql-scale)
- [SIGN](https://neon.com/postgresql/postgresql-math-functions/postgresql-sign)
- [SQRT](https://neon.com/postgresql/postgresql-math-functions/postgresql-sqrt)
- [TRIM_SCALE](https://neon.com/postgresql/postgresql-math-functions/postgresql-trim_scale)
- [TRUNC](https://neon.com/postgresql/postgresql-math-functions/postgresql-trunc)
- [WIDTH_BUCKET](https://neon.com/postgresql/postgresql-math-functions/postgresql-width_bucket)
