Question: How to get camera serial number from EXIF ?

---

Edit: some folk think that not all (or even many) cameras store serial number, but I tried four from different manufacturers and they do. So, let's just rephrase it as "How to get camera serial number from EXIF if there is any?"

Answer: 
As has been mentioned, not all cameras store the serial number. However, most of the DSLRs do.

The serial number is actually stored in the MakerNotes section of the EXIF. This is a proprietary section for manufacturers to write in whatever format they like.

I've extended the great work by [Jacob Seidelin](http://blog.nihilogic.dk/2008/05/reading-exif-data-with-javascript.html) (*< edit: the URL is a 404*) to extract the serial number with javascript on [my Site](http://www.stolencamerafinder.com/exif.jsp) which includes an offline version for Chrome for no other reason than to see if I could! It's open source so if you're looking for a javascript solution you're welcome to build on it etc.

The question doesn't include a programming language or any contsraints so the best answer currently is to use [exiftool](http://www.sno.phy.queensu.ca/~phil/exiftool/). It has the most complete support for different camera models and file formats (including brilliant support for how different applications butcher it!)

A simple example command to get the serial number would be:

```
exiftool -SerialNumber myImage.jpg

```

I writing my site, I've looked into this topic over **hundreds** of hours so if you have any more questions, let me know!
You can use [`exif_read_data`](http://www.php.net/manual/en/function.exif-read-data.php) to access EXIF information in php. A good code sample on how to use this command is shown in the manual within the link below.

<http://www.php.net/manual/en/function.exif-read-data.php>

But afaik currently not many cameras code the serial numbers into the EXIF blocks.