How to Change a File Extension on Windows, Mac, and Beyond
File extensions are more than just the letters after the dot in a filename — they tell your operating system what kind of data a file contains and which program should open it. Changing one sounds simple, but the process varies significantly depending on your operating system, and doing it incorrectly can make a file temporarily unusable. Here's what you actually need to know.
What Is a File Extension, Really?
A file extension is the suffix at the end of a filename, separated by a period — .jpg, .pdf, .mp4, .docx. The OS uses this tag to associate the file with the correct application. The extension doesn't change what's inside the file; it only changes how the system interprets and handles it.
This distinction matters. Renaming a .jpg to .png doesn't convert the image — it just changes the label. If you open it in an image editor, it may still work because the underlying data is the same. But if you rename a .mp4 to .pdf, nothing useful happens — the file's contents don't match the new extension, and most applications will either reject it or throw an error.
True file conversion (actually changing the format of the data) requires dedicated software. Changing a file extension is just renaming.
How to Change a File Extension on Windows
By default, Windows hides file extensions to protect everyday users from accidental changes. You'll need to make them visible first.
Step 1: Show File Extensions
- Open File Explorer
- Click the View tab (Windows 10) or the View menu (Windows 11)
- Check File name extensions
Once enabled, you'll see the full filename including the extension on every file.
Step 2: Rename the File
- Right-click the file and select Rename
- Edit the extension directly (e.g., change
document.txttodocument.md) - Press Enter
- Windows will warn you that changing the extension may make the file unusable — click Yes to confirm
You can also do this via Command Prompt:
ren oldfilename.txt newfilename.md Or with PowerShell for batch renaming across multiple files, which is useful when working with large folders.
How to Change a File Extension on macOS
macOS also hides extensions by default, but enabling them is straightforward.
Show Extensions System-Wide
- Open Finder
- Go to Finder → Settings (or Preferences on older versions)
- Under the Advanced tab, check Show all filename extensions
Rename the File
- Click the file once to select it, then press Return (or right-click → Rename)
- Edit the extension at the end of the name
- Press Return and confirm the change when prompted
macOS will warn you before applying a potentially incompatible extension change — pay attention to this prompt.
Changing Extensions on Mobile: Android and iOS 📱
Mobile operating systems handle files differently. Both Android and iOS largely abstract away file extensions from everyday users.
Android gives you more flexibility through file manager apps like Files by Google or third-party apps, which typically display full filenames with extensions and let you rename them directly.
iOS is more restrictive. The built-in Files app allows renaming, but extension visibility and editability depend on the file type and app association. Some extensions can be edited; others are hidden or locked. Third-party file manager apps on iOS often provide more control.
Batch Changing File Extensions
When you need to rename extensions across dozens or hundreds of files, manual renaming is impractical.
| Method | Platform | Skill Level |
|---|---|---|
| PowerShell script | Windows | Intermediate |
Command line (rename, mv) | Mac/Linux | Intermediate |
| Automator workflow | macOS | Beginner–Intermediate |
| Bulk rename utility apps | Windows/Mac | Beginner |
| Python script | Cross-platform | Advanced |
Tools like Bulk Rename Utility (Windows) or Automator (Mac) let you apply extension changes across many files without writing code. For developers, a simple PowerShell or Python script gives the most control and flexibility.
When Changing an Extension Actually Works — and When It Doesn't ⚠️
Some format pairs are close enough that renaming the extension works in practice:
.txt→.md(Markdown is plain text; most editors handle both).htm→.html(functionally identical).jpg→.jpeg(same format, different conventional extension)
Others require actual conversion:
.docx→.pdf(you need to export or print-to-PDF).png→.jpg(different compression — use an image editor).mp4→.mp3(video to audio — requires extraction software).xlsx→.csv(use Save As inside Excel or a spreadsheet app)
If you're unsure whether a format pair is compatible through renaming alone, the safest approach is to open the file in its native application and use Export or Save As to produce the new format properly.
The Variables That Determine Your Approach
How straightforward this process is depends on several factors:
- Operating system and version — extension visibility settings, available tools, and warning prompts differ between Windows 10, Windows 11, macOS Ventura or later, and mobile platforms
- Number of files — single files can be renamed manually; large batches usually benefit from scripting or a bulk rename tool
- Whether you need actual format conversion — renaming only works when the underlying data is already compatible with the target format
- Technical comfort level — command-line and scripting approaches are faster for power users but unnecessary for casual use
- File type — some formats (especially proprietary ones) are more sensitive to extension changes than others
The method that makes sense for one person — a developer batch-renaming thousands of log files — is completely different from what works for someone renaming a single downloaded document. Your OS, your workflow, and the specific files involved all shape which path is worth taking.