---
hide_title: false
hide_table_of_contents: false
pagination_next: null
pagination_prev: null
---
# URL.toString()

The **`URL.toString()`** method returns a
string containing the whole URL. It is effectively a read-only version
of `URL.prototype.href`.

## Syntax

```js
toString()
```

### Parameters

None.

### Return value

A string.
