Published · Updated

How to Change a File Extension Safely

Changing the letters at the end of a filename—from .dat to .pdf, .zip to .docx, or .jpeg to .jpg—takes two seconds, yet half the time it solves an unopenable download immediately and the other half it produces a “file is damaged or unsupported” error.

The difference comes down to one rule: renaming a file extension only changes the label your operating system reads—it never converts a single byte inside the file.

Before renaming anything, drop the file into File Sniff’s free local file type checker to inspect its internal magic bytes and confirm what format the file actually is.

When changing a file extension works (and is completely safe)

Renaming is the right fix whenever the file’s internal bytes already match the target format, and only the filename label is wrong or missing:

When changing a file extension breaks things (convert instead)

If the bytes inside the file belong to a different format, changing the extension only tricks an app into opening bytes it cannot parse:

How to show and change a file extension on each platform

By default, macOS and Windows hide known extensions, which causes a classic mistake: renaming invoice (whose hidden real name is invoice.dat) to invoice.pdf actually creates invoice.pdf.dat! Always reveal the full filename first.

On Mac (Finder)

  1. Select the file in Finder and press Cmd + I (File → Get Info)—this is safer than inline renaming because the Name & Extension box always displays the true extension, even if Finder hides extensions globally.
  2. Uncheck Hide extension if ticked, replace the suffix after the final dot, and press Return.
  3. Confirm the macOS prompt (“Are you sure you want to change the extension from…”).
  4. (Optional global setting) To always see extensions across Finder, open Finder → Settings → Advanced and tick Show all filename extensions.

If you fix mismatched extensions regularly on Mac, the native File Sniff app for Mac detects the true format from magic bytes and offers a one-click Fix Extension action with confirmation and full Cmd + Z Undo support.

On Windows 11 & Windows 10 (File Explorer)

  1. In File Explorer, open View → Show → File name extensions (Windows 11) or tick File name extensions on the View ribbon (Windows 10). Never rename extensions before enabling this toggle.
  2. Select the file, press F2, edit the characters after the final dot, press Enter, and click Yes on the confirmation dialog.

On iPhone & iPad (Files app)

  1. Open the Files app, tap the … (More) menu in the top-right corner → View Options, and enable Show All Extensions (iOS/iPadOS 16+).
  2. Touch and hold the file, tap Rename, move the cursor past the dot to change the extension, tap Done, and confirm Use .<ext>.

Security warning: disguised executables and double extensions

Attackers exploit hidden extensions using tricks like Remittance_Advice.pdf.exe, Scan_004.scr, Update.pkg or Unicode Right-to-Left Override characters. When File Explorer hides .exe, the victim sees only Remittance_Advice.pdf alongside a spoofed PDF icon.

Keep two safety habits whenever an attachment looks odd:

Inspect files natively
on Mac, iPhone & iPad.

File Sniff identifies files by their internal bytes, spots extension mismatches, reads metadata and scans folders locally on your device.

Download on the App Store ↗︎