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

The **`toJSON()`** method of the `URL` interface
returns a string containing a serialized version of the URL,
although in practice it seems to have the same effect as
`URL.toString()`.

## Syntax

```js
toJSON()
```

### Parameters

None.

### Return value

A string.
