Guides / File type and extension

How to search by file extension or file type on Mac

In Finder, press ⌘ F, click This Mac, and set the first rule to Kind (PDF, Image, Movie and so on) to search by file type, or to File extension to search for one extension such as docx. In Spotlight or the Finder search field you can type the same thing as kind:pdf, and Everything Locator, the quickest of the four, takes ext:pdf and lists every match as you type.

Works on macOS 15 and later. Updated November 2026.

File type or file extension: which one do you mean?

The two are close but not the same, and it decides which search to use.

Search by type when you want "all my photos"; search by extension when you want one format, such as only the HEIC files before converting them.

1. Everything Locator: ext: and the type macros

Everything Locator (free to try) keeps an index of the names of your files and searches it on every keystroke. Type an extension filter into its search field and the list is complete at once, with the folder, size and date of each file. It uses the search syntax of Everything by voidtools, so the queries are short:

SearchFinds
ext:pdfevery PDF in the index
ext:jpg;jpeg;png;heicfiles with any of these extensions (separate them with ;)
*.heicthe same idea as a wildcard: names that end in .heic
ext:pdf invoice|receipt dm:thismonthPDFs with "invoice" or "receipt" in the name, changed this month
~/Downloads/ ext:zip;dmg;pkg size:>100mbarchives and installers over 100 MB in Downloads
pic: dc:2026-10pictures of any format created in October 2026
doc: dm:thisweekdocuments changed this week
video: size:>1gbvideos over 1 GB
endwith:.tar.gznames with a double extension
file: !*.* ~/Documents/files in Documents with no dot in the name, so no extension

ext: is the search by extension. It ignores case, so ext:jpg also finds PHOTO.JPG, but .jpg and .jpeg are two extensions; list both. The macros are the search by type: pic: (pictures), video:, audio:, doc: (documents), zip: (archives and disk images), app: (Mac apps), folder: (folders only) and exe: (apps, installers and scripts). The filter bar above the results does the same with a click or with ⌥ ⌘ 1 to ⌥ ⌘ 8: Everything, Audio, Video, Documents, Pictures, Archives, Apps, Folders. The Extension column shows the extension of each result.

Press Space to preview a file, ⌘ Return to show it in Finder and ⇧ ⌘ C to copy its path. The other operators are in the Everything search syntax cheat sheet.

Two limits to know. The app goes by the name, so a picture someone renamed to .txt is found as a text file; Finder's Kind rule, below, looks at what the file is. And files under ~/Library or in other hidden folders appear only after you turn on Include hidden files in Settings › Indexing.

2. Finder: search by Kind (file type)

  1. Open a Finder window and press ⌘ F.
  2. At the top of the window, click This Mac to search everywhere, or the name of the current folder to stay inside it.
  3. The first rule already says Kind is Any. Click Any and choose a type: Application, Archive, Document, Executable, Folder, Image, Movie, Music, PDF, Presentation, Text or Other.
  4. Some types offer a second menu. Image can be narrowed to JPEG, PNG, HEIC, GIF, TIFF or BMP, Music to MP3 or AAC, and Text to Plain Text, Rich Text, HTML, XML or Source Code.
  5. Click the Add button (+) on the right, below the search field, for more rules, such as Name contains a word or Last modified date.

An item has to match all the rules. To keep the search, click Save below the search field; Apple's guide says it is saved as a Smart Folder, and Add To Sidebar puts it in the sidebar. When you remember the type but not the name, combine Kind with a date as in find a file when you don't remember the name.

3. Finder: search by file extension

  1. Start a search with ⌘ F as above.
  2. Click Kind and choose File extension. If it is not in the menu, choose Other…, select File extension in the list and click OK.
  3. Type the extension without the dot, for example docx.

A second way is the rule Name with ends with and .docx. For several extensions at once, hold ⌥ Option and click the button that replaces +; it adds a group where Any of the rules may match, and you put one File extension rule for each extension inside.

See the extensions in Finder. Finder hides many of them. Choose Finder › Settings, click Advanced and select Show all filename extensions. For one file, select it, press ⌘ I and look under Name & Extension, where Hide extension can be turned off.

4. Spotlight and the search field: kind:

Press ⌘ Space for Spotlight, or click the search field of a Finder window, and put kind: with a type after your words: budget kind:pdf or trip kind:image. Apple's Mac User Guide lists these keywords, among others:

TypeKeyword
Appskind:app or kind:application
Folderskind:folder
Imageskind:image
Movieskind:movie
Music and other audiokind:music, kind:audio
PDFskind:pdf
Presentationskind:presentation
Fontskind:font

The same guide says a minus sign leaves something out, as in trip -france. Spotlight also searches inside documents, which a name search cannot do. If these searches miss files you know are there, see Finder or Spotlight search not working.

5. Terminal

These commands only read:

# by extension, from the Spotlight index (the c ignores case)
mdfind -onlyin ~ "kMDItemFSName == '*.pdf'c"

# by type: every image in your home folder, whatever the extension
mdfind -onlyin ~ "kMDItemContentTypeTree == 'public.image'"

# the Spotlight keyword works here too
mdfind -onlyin ~/Downloads "kind:pdf"

# by extension, reading the folder itself (slower, sees hidden files)
find ~/Documents -iname "*.pdf"

# what macOS thinks one file is
mdls -name kMDItemKind -name kMDItemContentType ~/Desktop/photo.heic

mdfind answers from the Spotlight index, so it is quick but leaves out hidden folders such as ~/Library. find reads every folder each time, which is thorough and slow on a whole home folder. How to find files on Mac compares the built-in tools in more detail.

FAQ

How do I search for a file extension in Finder?

Press ⌘ F, click Kind and choose File extension (under Other… if it is not in the menu), then type the extension without the dot. The rule Name ends with .pdf works as well.

What is the difference between file type and file extension on a Mac?

The extension is the last part of the name, such as .png. The type, shown as Kind in Finder, is what the file is, such as "PNG image". One type can cover several extensions, which is why a Kind search for Image finds JPEG, PNG and HEIC files together.

Why does a search for .jpg miss some of my photos?

Photos are also saved as .jpeg, .heic and .png, and an extension search matches one ending only. Search by type instead (Kind is Image, kind:image, or pic: in Everything Locator), or list the extensions: ext:jpg;jpeg;heic;png.

Can I search for several file extensions at once?

Yes. In Everything Locator separate them with semicolons, as in ext:doc;docx;pages. In Finder, hold ⌥ Option while clicking the add button to make an Any group and add one File extension rule for each.

How do I find files with a double extension such as .tar.gz?

Match the end of the name. In Everything Locator type endwith:.tar.gz; ext: takes only the last part, gz. In Terminal, find ~ -name "*.tar.gz" does the same.

Every file of one type, as you type

Everything Locator searches your Mac by name, extension, type, size and date.

Mac App Store