Smart Systems for Home

Plain how-to guides for smart home, security and home Wi-Fi

Find Specific File Type Formats in macOS Search

· 5 min read · Home Tech

In this article
  1. Background: How macOS Search Works
  2. How to Search by File Type in Finder
  3. Common Problems and Solutions
  4. Using Spotlight Menu for Quick Type Searches
  5. How to Choose the Right Search Method
  6. Alternatives to Built-in Search
  7. Safety and Privacy Considerations
  8. Frequently Asked Questions

To find specific file type formats in macOS Search, use the Finder's search bar with the syntax kind:extension (e.g., kind:pdf) or filename:.ext (e.g., filename:.jpg). This directly filters results by file type, and you can combine it with other criteria like date or size for more precise searches.

Background: How macOS Search Works

macOS Search, powered by Spotlight, indexes your entire drive—including file names, content, and metadata—so you can find files by name, text inside documents, or attributes like date and kind. The Finder's search window (opened with Cmd+F in any Finder window) gives you a graphical interface to build complex queries, while the Spotlight menu (magnifying glass icon) offers a quick, but less detailed, search. Both use the same underlying indexing technology, but the Finder provides more control over file type filtering.

How to Search by File Type in Finder

Here are the most reliable methods to filter by file type:

  • Use the Kind button: In Finder, press Cmd+F. Click the “Kind” button in the search bar, then select a category like “Image,” “PDF,” “Document,” or “Folder.” You can add multiple criteria by clicking the “+” button.
  • Use the search syntax: Type kind:pdf (replace “pdf” with any file extension) directly into the search field. This works for most common extensions like kind:jpg, kind:docx, kind:xlsx, and kind:mp3.
  • Use filename with wildcard: Type filename:*.png to match files whose name ends with “.png”. This is more literal and works even if Spotlight hasn’t categorized the file type.
  • Use the “File Extension” attribute: Click the “+” button in Finder search, then select “File Extension” from the dropdown menu. Set the condition to “is” and type the extension (e.g., “pdf”). This is the most explicit method.

Common Problems and Solutions

Sometimes searches don’t return expected results. Here’s what to check:

  • File not indexed: If a file is on an external drive or in a folder excluded from Spotlight indexing, it won’t appear. Go to System Settings > Spotlight > Search Privacy and ensure the folder isn’t in the “Prevent Spotlight from searching these locations” list.
  • Extension not recognized: For uncommon file types (e.g., .heic, .webp), kind: may not work. Use filename:.heic instead.
  • Searching inside file contents: If you want to find a file by its content, not just its type, use the “Contents” attribute. In Finder search, click “+” and select “Contents” from the dropdown, then type a word that appears inside the document.
  • Case sensitivity: File extensions are case-insensitive in macOS, so kind:PDF and kind:pdf yield the same results.

Using Spotlight Menu for Quick Type Searches

The Spotlight menu (press Cmd+Space) is faster for simple queries. Type kind:pdf and it will show PDF files, but you can’t combine multiple criteria as easily as in Finder. For example, you can type kind:pdf modified:today to narrow by date, but the syntax is less discoverable. For most users, the Finder search is the better tool for file type filtering because it offers a visual interface and more attributes.

How to Choose the Right Search Method

Consider what you know about the file:

  • If you know the extension but not the name: Use filename:.ext or the “File Extension” attribute.
  • If you know the general category: Use the “Kind” button (e.g., “Image” for all image formats).
  • If you need to combine type with other criteria: Use Finder search with multiple “+” conditions (e.g., kind is “PDF” AND date is “This week”).
  • If you want a quick, single-criterion search: Use Spotlight menu with kind:ext.

If you frequently need advanced file type searches, consider these alternatives:

  • Smart Folders: Save a search as a Smart Folder (click “Save” in Finder search). It acts like a live folder that updates automatically as files are added or removed.
  • Terminal commands: Use find or mdfind for powerful command-line searches. For example, mdfind 'kMDItemFSName == "*.pdf"' finds all PDFs.
  • Third-party apps: Utilities like Alfred or HoudahSpot offer more flexible search interfaces, but they are not necessary for most users.

Safety and Privacy Considerations

Searching by file type is safe—it only reads metadata and file names, not the content of your files. However, be aware that Spotlight indexes the content of many documents (like PDFs and Word files) to enable content searches. If you have sensitive files, you can exclude them from indexing by adding their folder to the Search Privacy list in System Settings. This prevents their content from appearing in search results, though you can still find them by name if you use filename:.

Frequently Asked Questions

Why doesn’t “kind:pdf” find all my PDFs?

This can happen if the PDFs are in a folder excluded from Spotlight indexing, or if the index is outdated. Try reindexing by dragging the folder into the Search Privacy list and then removing it, or restart your Mac.

Can I search for multiple file types at once?

Yes, in Finder search, add multiple “File Extension” conditions with “OR” (hold Option while clicking the “+” button to change “And” to “Or”). For example, you can search for files with extension “.jpg” OR “.png”.

How do I search for files without an extension?

Use the “File Extension” attribute and set the condition to “is not” and leave the value blank, or use filename:*. (with a period) to match files with no extension—though this may not work perfectly. A more reliable way is to search for “Kind: Document” and then sort by name to spot files without extensions.

Does Spotlight search inside ZIP files?

No, Spotlight does not index the contents of ZIP archives by default. You’ll need to extract the archive first, or use a third-party tool that indexes archives.

Can I search by file type on an external drive?

Yes, as long as the drive is connected and Spotlight is allowed to index it. If you don’t see results, check that the drive is not in the Search Privacy list.