Find the Original File Extension?

I have changed the file extension in order to hide them (such as .avi or .mp4 to .stg) and forgotten the original extension, how to check the original extension and reconvert them?

4

4 Answers

On Linux and OSX there is a command

file yourfilename

that guesses the file type.

If you're comfortable programming in almost any language, you could write a script and just examine the first few bytes of the files headers and rename as appropriate. Most all video/picture/audio headers are available online.

2

Trid is a useful command line application that identifies a ton of filetypes. Assuming it actually is a file, it should help identify it.

It uses a slightly different strategy from file, and might detect possible filetypes rather than what the magic number of the file says

If you open the file in a HEX editor like HxD you will be able to see the file header on the right hand side, This will give you information about your file type.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Maya Lin-Takahashi

Maya Lin-Takahashi

Consumer Tech & Gadget Reviewer

Maya is a hardware enthusiast who tests and reviews smart home devices, smartphones, wearables, and audio gear. She focuses on practical consumer value and build quality.

Share this article
Twitter Facebook Pinterest