Want to quickly rename a file from photo.jpeg to photo.jpg — or change .txt files into .md? In this guide we’ll walk you through how-to-change-extension-of-file-in-windows-11-a-step-by-step-guide so you can safely rename single files, bulk-rename many files, fix broken file associations, and understand when you should convert a file instead of merely renaming its extension. Think of a file extension like a label on a jar — change the label and the jar’s contents don’t magically become different. Let’s keep it simple, practical, and safe.
📝 Quick summary — key takeaways
-
A file extension (like
.txt,.jpg,.pdf) tells Windows what type of file it is and which app should open it. -
Renaming an extension changes the label only; it does not convert the file format. Convert files when formats differ (e.g.,
.png→.jpg) using a proper converter. -
In Windows 11 you must show file name extensions before renaming them.
-
You can rename single files using File Explorer, rename many files using Command Prompt, PowerShell, or PowerToys PowerRename.
-
Always backup important files before bulk changes.
Why would you change a file extension? (and when you shouldn’t)
-
To fix a file that has the wrong extension (e.g.,
report.docxwas saved asreport.docx.txt). -
To make a file open with a different app by changing its extension.
-
During scripting or automation when renaming many files at once.
When not to change the extension:
-
If the file format itself is different (renaming
.pngto.jpgwon’t convert image data). Use a file converter instead. -
If you don’t have a backup and the file is important — renaming can break how apps open it.
What’s the difference between changing an extension and converting a file?
-
Changing extension = renaming the file suffix (label). Fast, but the file’s binary content remains identical.
-
Converting = changing the file’s internal format (e.g., audio
.wav→.mp3), which requires a program or online service that decodes and re-encodes data.
Analogy: renaming an extension is like sticking a different sticker on a VHS tape; converting is like transferring tape footage into a DVD.
How do I make Windows 11 show file extensions? (required first step)
Before you can change extensions you must be able to see them.
Method A — File Explorer quick menu (Windows 11)
-
Open File Explorer.
-
Click the three-dot menu (
…) on the toolbar. -
Choose View > Show > File name extensions.
-
Extensions (the
.xxxpart) now appear after file names.
Method B — Folder Options (classic)
-
Open File Explorer.
-
Click
…> Options to open Folder Options. -
Go to the View tab.
-
Uncheck Hide extensions for known file types.
-
Click OK.
Now you can see and edit .txt, .jpg, .exe etc.
How to change a single file’s extension using File Explorer (step-by-step)
This is the most user-friendly method.
-
Open File Explorer and navigate to the file.
-
Make sure File name extensions are visible (see previous section).
-
Right-click the file and choose Rename, or select it and press F2.
-
Carefully edit the text after the final dot. Example:
notes.txt→notes.md. -
Press Enter and confirm the change if Windows warns you.
Note: If Windows warns “If you change a file name extension, the file might become unusable,” that’s normal — it’s reminding you of the risk.
How to change a file’s extension using Command Prompt
Quick for power users and easy for single/multiple renames in the current folder.
Rename one file
-
Open Start, type
cmd, right-click Command Prompt, and select Run as administrator if needed. -
Change directory:
-
Rename the file:
Rename all .txt files to .md (bulk in current folder)
This command replaces the .txt suffix with .md for all matching files in the folder.
How to change extensions using PowerShell (more control)
PowerShell allows pattern matching and recursion.
Rename in a single folder
Rename recursively in subfolders
PowerShell is safer when you need complex patterns or previewing changes programmatically.
How to change many files with a GUI: PowerToys PowerRename
If you prefer a graphical batch rename tool, PowerToys (from Microsoft) includes PowerRename.
-
Install PowerToys.
-
Select multiple files in File Explorer, right-click and choose PowerRename.
-
Use search/replace or regular expressions to change extensions.
-
Preview results, then apply.
PowerRename is ideal when you want to preview before committing changes.
How to change which app opens an extension (file association)
Changing a file’s extension doesn’t always change how Windows opens it. To associate an extension with an app:
Quick way (single file)
-
Right-click the file → Open with > Choose another app.
-
Pick the app, check Always use this app to open .xyz files, then click OK.
Settings method (for all extensions)
-
Open Settings > Apps > Default apps.
-
Enter the extension (like
.pdf) or the app name. -
Select the default app you want Windows to use.
This sets the default program for that extension across your system.
When should you convert files instead of renaming extensions?
If the file’s internal format differs (audio, video, image, document), renaming the extension will often break the file. Examples:
-
.png→.jpg: change the label only? Not enough. Use an image converter to re-encode and avoid corruption. -
.docx→.pdf: you must export or print to PDF; renaming won’t convert content. -
.wav→.mp3: convert via audio software.
Use dedicated converters or apps (or online services) for real format changes.
Troubleshooting: file won’t open after changing the extension
If a file refuses to open after renaming:
-
Revert the extension to the original (see “How to revert” below).
-
Try opening with Open with > Choose another app and pick a program that supports the format.
-
If you changed many files at once, restore from backup or use
Ctrl+Zin File Explorer right after change (undo recent rename). -
If content got corrupted, use file recovery tools or check a backup.
How to revert a changed extension
If you made a mistake, revert quickly.
If you remember the old extension:
-
Rename it back using File Explorer (
F2) or Command Prompt:
If you don’t remember the original:
-
Try opening the file in a text editor (Notepad, Notepad++) to inspect the header bytes — often file headers reveal type (e.g.,
%PDFfor PDFs). -
Use a file-identification tool to detect file type from content.
Best practices and safety tips
-
Always backup important files (copy to another folder or external drive) before bulk renaming.
-
Use PowerRename or PowerShell preview scripts when doing large batches.
-
Remember: renaming ≠ converting. Use conversion tools for format changes.
-
Avoid renaming system files or files in system folders unless you know the impact.
-
For automation, keep a log of renames and test on a small subset first.
Quick command reference (table)
| Task | Command (Command Prompt) | Command (PowerShell) |
|---|---|---|
| Rename one file | ren example.txt example.md | Rename-Item example.txt example.md |
Rename all .txt → .md (folder) | ren *.txt *.md | `Get-ChildItem -Filter *.txt |
| Revert last rename (undo in Explorer) | Ctrl+Z in Explorer | Use logs or reverse script |
| Show files in folder | dir | Get-ChildItem |
Common scenarios & examples
-
Fixing “.docx.txt”: If an email client appended
.txt, renamereport.docx.txt→report.docx. -
Converting images: Don’t just rename
.pngto.jpg. Use an image editor or converter to re-encode. -
Changing
.htmto.html: Safe — these are equivalent for most web servers and browsers. -
Renaming
.jpeg→.jpg: Safe — these are interchangeable labels for the same JPEG format.
Can changing extensions be automated for recurring tasks?
Yes. Scripts (PowerShell or batch files) or scheduled tasks can automate renaming patterns. Example: a PowerShell script that renames .temp outputs to .log each night. Always log actions and test on sample files first.
Safety checklist before bulk renames
-
Back up the folder.
-
Preview changes (PowerRename or PowerShell dry-run).
-
Ensure no critical system files are included.
-
Confirm you’re in the correct directory.
-
Keep a way to revert (script or list of original names).
Conclusion — quick, safe, repeatable steps
Changing a file extension in Windows 11 is straightforward once you can see extensions. Here’s the shortest safe path we recommend:
-
Show file extensions in File Explorer.
-
Back up files you plan to change.
-
For single files: rename via File Explorer (F2).
-
For many files: use PowerToys PowerRename, Command Prompt (
ren), or PowerShellGet-ChildItem | Rename-Item. -
If file contents need actual format changes, convert the file with a dedicated tool.
By treating extensions like labels and knowing when real conversion is required, you’ll prevent confusion and file breakage. Ready to try it? Start with a single copy and practice — you’ll be confident in minutes.
FAQs (5 short, precise answers)
Q1: Will changing a .txt to .md convert the text into Markdown formatting?
No — changing .txt to .md only renames the file. It won’t add Markdown syntax. You still need to edit the file to add Markdown formatting.
Q2: I renamed .png to .jpg and now the image won’t open. What happened?
You changed the label but not the file encoding. Use an image converter to properly convert PNG to JPG or revert the extension and use the correct conversion tool.
Q3: How do I change the default app that opens .log files?
Right-click a .log file → Open with > Choose another app → pick the app and check Always use this app…, or go to Settings > Apps > Default apps and assign by extension.
Q4: Is bulk renaming with ren *.txt *.md safe?
It’s fast but permanent in that folder. Back up first. Also ensure patterns match only the files you want to change.
Q5: My files lost their icons after renaming. How do I fix that?
Icons are tied to file associations. Re-associate the extension with the correct app (right-click → Open with → Choose another app → Always use), or set default apps in Settings.
