Apple model identifiers
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.


Apple model identifiers. Gives you an approximation of the device based on the model identifier.

Each entry provides the following information (if available):

  • Device - the device name (eg. MacBook Pro, iPad 2, iPad Air)
  • Generation - device generation (eg. Late 2006)
  • Variant - variants within the same generation (eg. 17-inch, Retina)


Created by Joris Kluivers (@kluivers on Twitter).

When using this file consider:

  • Bitcoin: 1AKhoHUVfcQ3E5PApytySgDwPgL3PpbyoF
  • Litecoin: LZyxW1Czfrrf7hfst6qztMgpWDxpeXDAjp

Find the identifier

To find your Mac model identifier, on the command line try:

$ sysctl -n hw.model

or in code:

#include <sys/types.h>
#include <sys/sysctl.h>

	char *propertyName = "hw.machine";
	char *propertyName = "hw.model";

size_t size;

// Mac: use 'hw.model'. On iOS use 'hw.machine'
sysctlbyname(propertyName, NULL, &size, NULL, 0);

char *model = malloc(size);
sysctlbyname(propertyName, model, &size, NULL, 0);

// model identifier as NSString
NSString *modelIdentifier = [NSString stringWithCString:model encoding:NSUTF8StringEncoding];


Identifier Uniqueness

Be aware that a single identifier may refer to multiple models from different years or with different characteristics. In this case the Generation and/or the Variant could not be determined exactly and the key may be missing.

Somewhere around 2010 this practice was changed and from that point on most models have their own unique identifier.


Related Apple support pages: