# Convert an absolute path to a file URL

> Convert an absolute filesystem path into a `file://` URL with `Bun.pathToFileURL()`.

Use `Bun.pathToFileURL()` to convert an absolute path to a `file://` URL.

```ts
Bun.pathToFileURL("/path/to/file.txt").href;
// => "file:///path/to/file.txt"
```

---

See [Utils](https://bun.aphrody.app/docs/runtime/utils).
