Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a textfile and I want to know whether it is Ascii or UTF-8 or something else. How can I see this? Any tool or website that I can use?

share|improve this question
Unless the file contains a BOM there is no 100%-sure way of doing this. – Ignacio Vazquez-Abrams Dec 29 '10 at 9:03
@Ignacio Vazquez-Abrams I cannot recall ever opening a file in Notepad++ where something related to the encoding was not displayed in the bottom right hand corner of the screen, but maybe I have never run into a file without a BOM. Even if a file didn't contain a BOM, couldn't a person just open a file in Notepad++ as I suggested in my answer and select from the various encoding settings until one looked right? Then we would know the selected setting was the encoding of the file. – ubiquibacon Dec 29 '10 at 13:54
@typoknig: Assuming the person going through the various encodings has some idea of what it's supposed to look like, sure. But it is possible to fool people with some of the old DOS codepages. – Ignacio Vazquez-Abrams Dec 29 '10 at 14:17
up vote 1 down vote accepted
$ file unicode.txt
unicode.txt: UTF-8 Unicode text

I expect the file utility is available for Windows as part of CygWin

I'm surprised it isn't included in UnxUtils or GNU CoreUtils for Windows

As Ignacio Vazquez-Abrams suggests, for many files, software tools can only make a guess based on sampling and probabilites.

share|improve this answer
It was never a part of coreutils. – Ignacio Vazquez-Abrams Dec 29 '10 at 12:11
+1 for "file for windows" – RedGrittyBrick Dec 29 '10 at 12:16

Use Notepad ++. The information you are looking for is displayed in the bottom right hand corner of the screen.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .