---
title: Convert a file URL to an absolute path
sidebarTitle: File URL to path
mode: center
---

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

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

---

See [Utils](/runtime/utils).
