User Agents

Web browsers and everyday web tech, explained

Easy Spotlight Restart Mac Filename Extensions?

· 6 min read · Extensions

In this article
  1. Why Spotlight Search Goes Wrong
  2. How to Restart Spotlight Indexing
  3. What Filename Extensions Have to Do With It
  4. How to Show or Hide Filename Extensions
  5. Common Problems and Misconceptions
  6. Alternatives to Restarting Spotlight
  7. Safety and Time Considerations
  8. Frequently Asked Questions

To restart Spotlight indexing on a Mac, you do not need to touch filename extensions at all — the two are unrelated. However, if you are seeing file extensions hidden in Spotlight results or in the Finder, the fix is a simple Finder setting, not a Spotlight restart. This article explains how to restart Spotlight indexing when search results are missing or stale, and separately how to show or hide filename extensions on your Mac.

Why Spotlight Search Goes Wrong

Spotlight builds a search index of your entire drive so that queries return instantly. The index is stored in a hidden folder on each volume, and macOS updates it continuously as files change. Problems occur when the index becomes corrupted, partially built, or out of date. Symptoms include:

  • Files you know exist do not appear in search results
  • Results are slow to load or incomplete
  • Search returns old versions of files that have been moved or renamed
  • Spotlight uses high CPU for no apparent reason

In most cases, rebuilding the index fixes these issues. The process is safe and does not affect your files or their names — including whether extensions are shown.

How to Restart Spotlight Indexing

There are two reliable ways to force Spotlight to rebuild its index. Both are built into macOS and require no third-party tools.

Method 1: Use System Settings (macOS Ventura and later)

  1. Open System Settings from the Apple menu.
  2. Click Spotlight in the sidebar.
  3. Scroll down and click Search Privacy…
  4. Drag your entire hard drive (usually named “Macintosh HD”) into the list. If prompted, enter your administrator password.
  5. Wait a few seconds, then select the drive in the list and click the minus (−) button to remove it.
  6. Spotlight will now rebuild the index for that drive. This can take from minutes to hours depending on drive size and speed.

Method 2: Use Terminal (all recent macOS versions)

  1. Open Terminal (in /Applications/Utilities).
  2. Type the following command and press Return:
    sudo mdutil -E /
  3. Enter your administrator password when prompted.
  4. To confirm indexing is enabled, run:
    sudo mdutil -s /

The -E flag erases the index and rebuilds it from scratch. The -s flag shows the current status. If you have multiple volumes, repeat the command with the correct mount point (e.g., /Volumes/ExternalDrive).

What Filename Extensions Have to Do With It

Filename extensions (like .jpg, .pdf, .docx) are simply the suffix after the last dot in a file name. They tell macOS and apps what type of file it is. Spotlight indexes the full file name, including the extension, but whether you see the extension is controlled by the Finder, not Spotlight.

If you have hidden extensions and you are trying to identify a file type in Spotlight results, you might mistakenly think Spotlight is broken. In reality, the extension is there but hidden. Conversely, showing extensions does not affect Spotlight’s indexing or search behavior — it only changes how names are displayed.

How to Show or Hide Filename Extensions

To control whether extensions appear in the Finder and in Spotlight results:

  1. Open a Finder window.
  2. From the menu bar, choose Finder → Settings (or Preferences on older macOS).
  3. Click the Advanced tab.
  4. Check or uncheck “Show all filename extensions.”

This applies globally to all files. To change it for a single file, select the file, press Command-I to Get Info, and check or uncheck “Hide extension.”

Common Problems and Misconceptions

One common misconception is that restarting Spotlight will fix hidden extensions. It will not — those are separate settings. Another is that you need to delete the entire index manually from the Finder. That is not necessary; the methods above are the official ones.

If Spotlight still does not find files after rebuilding, check that the folder containing the file is not excluded from indexing. In System Settings → Spotlight → Search Privacy, any folder or drive listed there is excluded. Remove it if you want it searched.

Also note that if you are searching for a file with a hidden extension, typing the extension in Spotlight will still match the file, because the index stores the full name including the extension, even if it is not displayed.

Alternatives to Restarting Spotlight

If rebuilding the index does not help, or if you prefer not to wait, consider these alternatives:

  • Use Finder’s search with the “Name matches” or “Name contains” criteria — it uses a live search that does not rely on the Spotlight index.
  • Use the “Go to Folder” command (Shift-Command-G) in Finder to navigate directly to a known path.
  • Use third-party search tools like Alfred or Find Any File, which can search without the Spotlight index (though they may be slower).

These are not replacements for a healthy index, but they can help you locate a file while you wait for the rebuild to finish.

Safety and Time Considerations

Rebuilding the Spotlight index is safe. It does not modify, move, or delete any of your files. The only downside is the time it takes — on a large drive with many files, it can take several hours. During that time, Spotlight searches will be incomplete, and you may notice increased disk activity and CPU usage. It is best to do this when you do not need to rely on Spotlight immediately.

If you are using a laptop, keep it plugged in during the rebuild to avoid sleep interrupting the process. You can also pause indexing by turning off Spotlight in System Settings, but that is not recommended as a permanent solution.

Frequently Asked Questions

Does restarting Spotlight change my file extensions?

No. Restarting Spotlight only rebuilds the search index. It has no effect on file names, extensions, or any file content. To show or hide extensions, use the Finder settings described above.

Why are my file extensions missing in Spotlight results?

Spotlight results display the file name as the Finder would. If extensions are hidden in Finder, they will also be hidden in Spotlight. Check Finder → Settings → Advanced → “Show all filename extensions.”

How long does it take to rebuild the Spotlight index?

It depends on the number of files and the speed of your drive. A typical internal drive with 100,000 files might take 30 minutes to a few hours. You can check progress by running mdutil -s / in Terminal — it will show “Indexing” and a percentage.

Will rebuilding Spotlight delete any of my files?

No. The index is a separate database that contains metadata about your files. Rebuilding it only recreates that database from the current files. Your actual files are untouched.

Can I restart Spotlight without using Terminal?

Yes. Use System Settings → Spotlight → Search Privacy as described in Method 1. That is the graphical way to trigger a rebuild.

What if Spotlight still doesn’t find a file after rebuilding?

First, check that the file’s folder is not in the Search Privacy exclusion list. If it is not, try renaming the file slightly (e.g., add a space) and then rename it back — this forces a metadata refresh. If the problem persists, the file may be in a location that Spotlight does not index by default, such as certain system folders or network volumes.