How to change a file type (and when renaming breaks it)
Windows 11 and macOS, with the cases where a rename is the wrong tool.
A file's type shows in its extension, the letters after the last dot, but it is decided by the bytes inside. Changing the extension is a rename: it takes seconds and works when the contents already match the new type. To turn one format into another, you have to convert the file, because renaming does not convert anything.
Change a file extension in Windows 11
- Open File Explorer and go to the folder that holds the file.
- In the toolbar, choose View, then Show, and tick File name extensions. Windows hides the extension of known file types until you do.
- Select the file and press F2, or right-click it and choose Rename.
- Replace the letters after the last dot with the new extension and press Enter.
- Windows warns that the file might become unusable. Choose Yes to keep the new extension.
Change a file extension on a Mac
- In Finder, open the Finder menu, choose Settings (Preferences on macOS versions before Ventura) and select the Advanced tab.
- Tick Show all filename extensions.
- Select the file and press Return, or choose File, then Get Info, and edit the Name & Extension field.
- Replace the letters after the last dot with the new extension and press Return.
- macOS asks whether to keep the old extension or use the new one. Choose Use followed by the new extension.
Get Info also has a Hide extension checkbox for a single file. It only matters while Show all filename extensions is off; with that setting on, Finder shows every extension.
When renaming works
A new extension is enough whenever the bytes are already what that extension promises. Three common cases:
- Plain text to plain text. A .txt file whose lines are values separated by commas becomes a working .csv the moment you rename it, and a spreadsheet opens it as a table. The same goes for text that is valid JSON or a log.
- Two spellings of one format. .jpeg and .jpg, .htm and .html, .tif and .tiff name the same format, so switching between them changes nothing a program cares about.
- A missing or wrong extension. A download saved without an extension, or with the wrong one, opens normally once it gets the extension that matches its contents. Check those contents first, as described below.
When renaming breaks a file
Renaming does not convert. When the new extension names a different format, the program that opens it expects one kind of data and finds another, and it shows an error or nothing at all.
- .heic to .jpg. The photo stays HEIC data inside a file that claims to be a JPEG, so apps and websites that expect a JPEG refuse it or fail to show it. Convert it instead: on a Mac, open it in Preview, choose File, then Export, and pick JPEG.
- .docx to .pdf. A Word document is a ZIP archive of XML files and starts with the bytes PK, while a PDF starts with %PDF. A PDF reader cannot open the renamed file. In Word, use File, then Save As, and choose PDF; in LibreOffice Writer, use File, then Export as PDF.
- .mkv to .mp4. Both are video containers, but different ones, so most players read the header, see Matroska and refuse or ignore the name. Convert the video with a tool such as HandBrake or the Convert function in VLC.
A rename is always reversible. Give the file its old extension back and it opens as before, because nothing inside it changed.
Check what a file really is
Most binary file formats start with a fixed signature, a few bytes that identify the format whatever the file is called. The file identifier on the home page reads those bytes in your browser, without uploading the file, and tells you the real type and whether the name matches it. The list of file signatures shows the bytes each format starts with.
Do this before you rename: if the identifier says your .jpg is really a HEIC, a new extension will not help and a conversion will.
Frequently asked questions
Does changing a file extension convert the file?
No. Renaming changes the name only; the bytes inside stay exactly as they were. A HEIC photo renamed to .jpg is still a HEIC photo, and a Word document renamed to .pdf is still a Word document. To change the format itself, open the file in a program that reads it and export or save it in the new format.
Why can't I see file extensions in Windows 11?
Windows hides the extension of file types it knows by default. In File Explorer, choose View, then Show, and tick File name extensions. The setting applies to every folder.
How do I change a file type on a Mac?
Turn on Finder, Settings, Advanced, Show all filename extensions. Then select the file, press Return and edit the part after the last dot, or edit the Name & Extension field in Get Info. Confirm with Use when macOS asks which extension to keep.
I renamed a file and now it will not open. How do I fix it?
Rename it back to the extension it had before. Nothing inside the file changed, so it opens again as soon as the name matches its contents. If you no longer know the original extension, the identifier on the home page reads the file's first bytes and tells you.
Is it safe to change a file extension?
Renaming never alters the data, so it cannot damage a file, although a program may refuse or misread it until the name is right again. Showing extensions is also a safety habit: with them hidden, a file named invoice.pdf.exe appears as invoice.pdf while it is really a Windows program.
Looking for a format? Browse the file extensions list.