Start with Finder
Open Finder, select the file, and press Command-I. You can also choose File > Get Info. Expand the More Info section if it is closed. When the source was saved, Finder may show a Where from field with one or more links.
The first link is often the direct address of the file. Another link may be the web page that contained the download button. This is useful when a server uses an unclear filename such as document.pdf, release.zip, or a long string of numbers.
Finder is the simplest choice when you already know which file you need to inspect. It is less helpful when you remember the website but not the filename.
Check the source in Terminal
macOS exposes the same information through Spotlight metadata. Open Terminal and enter:
mdls -name kMDItemWhereFroms "/path/to/file.pdf"
You do not need to type the path by hand. Type the command and a space, then drag the file from Finder into the Terminal window. macOS inserts the path for you. Press Return to run it.
If source information is present, the result contains one or more strings. If the result is (null), Spotlight does not currently have that field for the file. That does not prove the file was never downloaded. It only means the metadata is not available.
Search by a website you remember
If you remember downloading something from GitHub, a bank, a client portal, or a cloud drive, search the saved source instead of guessing the filename. A Terminal query can look like this:
mdfind -onlyin ~/Downloads 'kMDItemWhereFroms == "*github.com*"c'
Replace github.com with the domain you remember. The final c makes the comparison case-insensitive. The -onlyin option limits the search to Downloads. Spotlight indexing must be available for this query to work.
Quotes matter in Terminal, especially when a path has spaces. Do not paste a command that deletes or changes extended attributes. Reading with mdls and searching with mdfind are enough for this task.
Search a folder without Terminal
Download Detective is a native Mac app made for this exact problem. Choose Downloads or another folder and it reads the source metadata already attached to the files. A sidebar groups results by website. You can then search names, paths, extensions, domains, and full source URLs.
The app is read-only. It does not move or edit files, and the scan stays on your Mac. Select a result to see every saved source URL, use Quick Look, reveal it in Finder, or open the source page in your browser.
Why “Where from” may be missing
The app or browser that created the file must save the source information. Some do not. Metadata can also disappear when a file passes through an archive, cloud service, network share, external disk, or filesystem that does not preserve Mac extended attributes.
A locally created file normally has no download source. A file copied from another computer may also arrive without one. No Finder setting, command, or app can reliably rebuild a URL that was never saved. Browser history may help, but it is separate from file metadata.
A quick way to choose the right method
- You know the file: use Finder Get Info.
- You want the exact metadata value: use
mdls. - You remember the website: use
mdfindor Download Detective. - You have many folders or file types: choose one parent folder in Download Detective and filter the results.
- The field is missing: check browser history, email, or the service you used, but treat the original URL as unknown.
The important point is that download source metadata belongs to the file. Moving a file within the same Mac often keeps it, so it can still be useful long after the Downloads folder has been tidied.