How to convert an unknown file to MP3?

If you play the file by dragging and dropping, pause or stop it, then:

  • go to play-list,
  • right-click on the problem file, and
  • click Information...

The Codec tab will tell you what kind of file it is, and you can now exit and rename the file to add an appropriate extension.

Don't convert the file! This will take time and degrade the quality. If you don't know what the appropriate extension should be, rename it to FileName.vlc and associate this extension with VLC (any unused extension could be used, but this one is unlikely to be used by anything else).


EDIT
To anyone who has exactly the same problem: don't let my answer misguide you. AFH's answer is right, it is better not to convert. Still, OP asked for it, OP got it.

Original answer:
If VLC can play this file it probably can convert it. There is convert/save entry in file menu (I have Polish locale set; actual entry may be slightly different in English). Add your file with add button, then pick convert from dropdown menu at the bottom. My VLC has MP3 profile out of the box.


If you absolutely must convert the file to mp3, I would recommend ffmpeg.

You can convert your file on the command line:

ffmpeg -i random-audio-file -c:a libmp3lame -q:a 4 foobar.mp3

But as stated by others, if VLC can already play it, there's no need to convert it (and thus lose quality).

It's better to identify the filetype or codec, and rename the file to the appropriate extension which you can then bind in Windows to open with VLC by default.

To identify the filetype or audio format, you can use ffprobe (which is also part of ffmpeg). Or use various other tools such as MediaInfo which is perhaps more user friendly, especially for Windows users.