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.


Blind, quick and dirty.

You stated that yours is an mp3 file without the extension (vlc played it).
You have not to convert it, you have simply to rename it adding the extension .mp3.
If you convert it you will loose something in term of quality.

Note that even if it was not an mp3 file probably each version of VLC will play it anyway even if you rename it with a wrong extension. The problem, if present, will remain but you will not be aware...


If you feel unconfortable reading the above answer maybe you want to read some lines more...
... A wiser way to proceed is to recognise which kind of file it is and which tools can help you...
but this is another quest(ion), many time asked, answered and closed before [q1],[q2]:-).

It is often possible because many standards require identification codes in specific parts of the file, usually in the beginning. That is the reason because vlc can play even a part of a file (not yet fully downloaded).

More you know about the file more ideas car arise after. So what are your options?

  • Vlc can do it, as suggested in another good answer [1].
  • If you have many files, it can be time consuming to repeat with a GUI that operation each time.
    Many tools, as for example TrID [2], can identify them for you and eventually automatically rename all the files.
  • Unfortunately, windows 7 by default do not include the gnu file command [3]. But fortunately you can download and install it. Then from a shell (execute the program cmd.exe), you can arrive to your file (cd yourpath) then write the command

    file MyUnknowFile
    

    and it will answer with something like

    Audio file with ID3 version 2.3.0, contains: MPEG ADTS, layer III, v1, 192 kbps, 44.1 kHz, Stereo

    I put in bold MPEG and layer III... so this is an mp3 file and this is the extension that your file has somehow lost. You have only to add it to your file. Do you remember "more you know ... more ideas"? I can read with ID3 and that gives me another idea (see below).

  • You can use an ID3 tag renamer [q3], yes you can change not only the extension but even the filename compliant with the information included in the ID3 tag !
  • You can use an online service to identify the song. Some of them are able to overcome the wrong extension too...

But the path of an heroic champion pass through the hard way. The way of the paladin is to see the binary (maybe the hexadecimal) code of your file in search of the magic numbers [w1] looking in a reference table [w2] to understand which file is... and eventually re-invent the wheel. :-).