> ## Documentation Index
> Fetch the complete documentation index at: https://bun-1dd33a4e-farm-084c10c9-docs-lifecycle-supported-scripts.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Convert an absolute path to a file URL

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

```ts theme={null}
Bun.pathToFileURL("/path/to/file.txt");
// => "file:///path/to/file.txt"
```

***

See [Utils](/runtime/utils).
