How to Change a File Type or Extension

How to see and change file extensions on Windows, Mac, iPhone and Android, when renaming a file works, and when it needs converting instead.

Changing a file’s type sounds like one job, but it is really two different ones. Sometimes you only need to change the name at the end of the file. Other times the contents of the file have to be rebuilt in a new format. Doing the first when you need the second is the most common reason a file “breaks” after renaming.

The short answer

  • Renaming the extension changes the label, not the contents. It works only when the label was wrong or when two extensions mean the same format, such as .jpeg and .jpg.
  • Converting rewrites the data into a different format, such as PNG to JPG or HEIC to JPG. It needs a converter.
  • If you rename photo.png to photo.jpg, the file is still a PNG inside. Some apps cope; many show an error.

What a file extension is

The extension is the part of the name after the last dot: .jpg, .pdf, .mp3. Your computer uses it to decide which app opens the file and what icon to show. The real format is decided by the data inside, which usually starts with a short signature. For example, every PNG file begins with the same eight bytes, and every PDF begins with %PDF. Apps that care about the format read that signature and ignore the name, so a renamed file can’t fool them.

How to show file extensions

Windows and Mac hide extensions by default, which makes it hard to see what you are renaming.

Windows 11

  1. Open File Explorer.
  2. Select View in the toolbar, then Show.
  3. Tick File name extensions.

Windows 10

  1. Open File Explorer.
  2. Open the View tab.
  3. Tick File name extensions.

Mac

  1. In Finder, open the Finder menu and choose Settings (called Preferences on older versions).
  2. Select Advanced.
  3. Tick Show all filename extensions.

iPhone and iPad

In the Files app, open a folder, tap the ⋯ menu, choose View Options, then turn on Show All Extensions. This option is available on iOS and iPadOS 16 and later.

Android

Most file manager apps, including Files by Google, show the full name with the extension when you rename a file.

How to rename an extension

  • Windows: select the file, press F2, change the text after the dot, and press Enter. Windows warns that the file might become unusable. Choose Yes only if you are sure the rename is the right fix.
  • Mac: select the file, press Return, edit the extension and press Return again. Finder asks whether to keep the old extension or use the new one.
  • iPhone: in Files, touch and hold the file, choose Rename, and edit the extension.

When renaming is enough

Renaming fixes the file when the format inside already matches the new extension:

Rename Why it works
.jpeg ↔ .jpg ↔ .jfif All three are the same JPEG format
.htm ↔ .html Same web page format
.tif ↔ .tiff Same TIFF image format
.yml ↔ .yaml Same text format
.txt → .csv Only if the text is already comma-separated values
.m4a → .m4r An iPhone ringtone is the same AAC audio in an MPEG-4 file; ringtones also have a 40-second limit

It also fixes files that were saved with the wrong extension by mistake, which is common with images downloaded from websites.

When you need to convert

If the formats are genuinely different, the data has to be decoded and written again. Renaming won’t do it.

You have You need What to use
PNG JPG PNG to JPG
HEIC (iPhone photo) JPG HEIC to JPG
WebP saved from a website JPG or PNG WebP to JPG or WebP to PNG
JPG PNG JPG to PNG
A large photo A smaller file Compress images

Converting can change the file in ways renaming never does. Converting to JPG removes transparency, for example, and converting to a lossy format discards some detail. Each converter page on xconverter lists exactly what changes.

How to check what a file really is

If a file won’t open after downloading or renaming, find out its real format:

  • Open it in a browser tab. Drag it into Chrome, Edge, Firefox or Safari. Browsers read the data, not the name, so an image or PDF opens even with the wrong extension.
  • Mac: select the file and press Command + I. Kind shows the type macOS detected.
  • Use the drop box on the xconverter home page. It reads the extension and lists matching converters. Your file stays on your device.

A safety warning about double extensions

Malicious files often hide behind a double extension such as invoice.pdf.exe. With extensions hidden, it appears as invoice.pdf, but it is a program that runs when opened. Keeping extensions visible is one of the simplest ways to spot this. Never rename a program file to a document extension to “open” it, and never run a file you weren’t expecting.

Summary

Show extensions first, so you can see what you have. Rename only when the formats are the same underneath. For everything else, convert the file, and check the converter page for what changes in the process.

Converters for this guide

Formats in this guide