How do I identify which CPU a MacBook uses?

Solution 1:

First off, you are not going to get the processor microarchitecture name (Broadwell, Sandy Lake, Ivy Bridge, etc.) because it's not a prominent branding scheme for the Intel processors. Contrast that with Apple, the marketing department chooses to actively market the code names of their operatings systems (Mavericks, Yosemite, El Capitan). It's a marketing convention, not a technical one.

For a list of all Intel Processors and their codenames, architectures and specs, Wikipedia's List of Intel Microprocessors has a good page.

So, to answer this question, I am going to provide three methods to find out what CPU you have, the first two, which should be good for most users, and a third method in which you can determine the microarchitecture number so you can look it up on Intel's support site. You can "jump" to the section that applies to you.

  1. About this Mac (general CPU info)
  2. System Profiler (general CPU info)
  3. Terminal (detailed CPU info)

About this Mac

Clicking on the Apple symbol at the top of your screen, select About this Mac

enter image description here

You will get a screen that gives you an overview of your system. Your processor will be listed here.

enter image description here


System Profiler

Clicking on the button marked System Report... (green arrow) you get a complete profile of your system. On the first page, it will give you more detailed info about your machine, including processor info

enter image description here

Terminal

I am a fan of Terminal in general. Pretty much everything you see in the GUI in OS X can be accessed quicker and more accurately through the command line, IMHO.

To get the exact CPU model including the microarchitecture number, in Terminal, execute the following command:

sysctl -n machdep.cpu.brand_string

You will get the exact processor that you are using. For instance, on my iMac, it the command above responds with:

Intel(R) Core(TM) i7-3770 CPU @ 3.40GHz

You can then do a search for i7-3770 and pull up the code name and specs.

Just for reference, you can use the Terminal command:

system_profiler SPHardwareDataType

and get a result that looks just like the screen that I posted in the second section, System Profiler:

Hardware Overview:

  Model Name: iMac
  Model Identifier: iMac13,2
  Processor Name: Intel Core i7
  Processor Speed: 3.4 GHz
  Number of Processors: 1
  Total Number of Cores: 4
  L2 Cache (per Core): 256 KB
  L3 Cache: 8 MB
  Memory: 32 GB
  Boot ROM Version: IM131.010A.B09
  SMC Version (system): 2.11f14
  Serial Number (system): XXXXXXXXXXXXXXXXXXX
  Hardware UUID: XXXXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXX

(Credit to dante12 below)

So, if you needed your CPU or more commonly, your Model Identifier, you can use the same command coupled with grep.

system_profiler SPHardwareDataType | grep Identifier

It responds back with

  Model Identifier: iMac13,2

Solution 2:

Open Terminal and type or copy and paste the following command(s)

system_profiler SPHardwareDataType | grep Processor

or

system_profiler SPHardwareDataType

or

sysctl -n machdep.cpu.brand_string
sysctl -a | grep cpu

Also, I've found a nice script on Github (Thanks to @rbanffy):

open http://www.google.com/?q=$(sysctl -n machdep.cpu.brand_string 
                              | awk '{FS=" " ; print $2 "+" $3 "+" $4}')+site:ark.intel.com

Solution 3:

The CPU has its own model number string built in. Software can run the CPUID instruction with the right parameters to copy the string into registers. The string will be something like "Intel(R) Core(TM) i7-3770 CPU @ 3.40GHz". You can get it from the command-line with

sysctl -n machdep.cpu.brand_string

I don't actually know OS X. I'm answering this as someone who is often frustrated by benchmark numbers in SO answers that don't mention the hardware. On Linux, some distros ship lscpu and/or x86info, but neither of them decode the model number into an Intel code-name either. The numbers follow a pattern, so it's fairly easy to decode (see below).

None of the existing answers have mentioned any GUI method that gives the model number. All the GUI methods just show you "Core i7", which is nowhere near sufficient. Please don't tell people you have "a core i7", because that just wastes everyone's time.

"i7" could be anything from Nehalem to Skylake. There are huge differences between Nehalem and Sandybridge, and important differences from SnB to Haswell to Skylake.


If someone asks you what microarchitecture you ran your benchmark on, the model string from that is a great reply containing more information than just the microarchitecture name, so just copy&paste it to them (e.g. "i7-3770 CPU @ 3.40GHz").

Most people who ask you that will know how to decode model numbers, so don't feel like you need to summarize it or look it up for them. I'd much rather someone copy/pasted the exact model number, since I can google it to find out details like cache size. (http://ark.intel.com/ has a page for each model, and those usually come up high in google's search results. However, those don't use the codenames).

  • i3/i5/i7 xxx (3 digits) is Nehalem or Westmere (identical performance, so it doesn't matter)
  • i3/i5/i7 2xxx or Xeon E3/E5 XXXX v1 is Sandybridge (SnB)
  • i3/i5/i7 3xxx or Xeon E3/E5 XXXX v2 is IvyBridge (IvB)
  • i3/i5/i7 4xxx or Xeon E3/E5 XXXX v3 is Haswell (HSW)
  • i3/i5/i7 5xxx or Xeon E3/E5 XXXX v4 is Broadwell (BDW)
  • i3/i5/i7 6xxx or Xeon E3/E5 XXXX v5 is Skylake (SKL)

There are "Pentium" and "Celeron" models of each microarchitecture, but they have AVX disabled so people only use them for ultra-budget machines.

The "i7 extreme" CPUs are an exception to this. e.g. i7-5960X is still Haswell, but is 8 core (16 hyperthreads) with quad-channel memory. IDK if Apple sells any machines with such CPUs.

Wikipedia has excellent tables of model numbers for each microarchitecture. e.g. you can google x5690 wikipedia to quickly find that a Xeon X5690 is a Westmere architecture processor.


To learn more about the differences between the pipelines of various microarchitectures, see articles like this Ars Technica one about Haswell. Even the Wikipedia articles are not bad.

For a more technical CPU architecture point of view, see David Kanter's excellent Sandybridge and Haswell writeups.

Agner Fog's microarchitecture PDF is excellent if you're analyzing / tuning assembly language (or compiler output), e.g. trying to make sense of perf counters.

Intel's and AMD's optimization manuals also have some microarchitectural details, but don't always explain their asm optimization suggestions with analysis of how the microarchitecture operates. This is why I prefer Agner Fog's guide.

Also see the Stackoverflow x86 tag wiki, which I've expanded/improved a lot in the past year.

Solution 4:

gcc or clang -march=native can print a code-name for you, because the names of the tuning options match Intel's uarch codenames (e.g. -march=sandybridge). For AMD: -march=bdver2 = Piledriver = Bulldozer version 2.

clang-3.5 -v -xc /dev/null -O3 -march=native -o- -E 2>&1 | grep -o 'target-cpu \w*'

On my Linux Core2 system prints: target-cpu core2. I assume it will do something similar on OS X.

gcc -v -xc /dev/null -O3 -march=native -o- -E 2>&1 | grep -o 'arch=\w*'

on my Linux Core2 system prints:

arch=native
arch=core2        <----- This one
arch=native

This command compiles /dev/null as C (-xc). gcc / clang -vprints its internal commands as it runs them, with full command line args. Even with-E(preprocessor-only), the-xcoption leads gcc to pass the full set of-march=whatever -mmmx -msse2 ...` options.

grep -o prints only the matching part of lines that match. \w* matches 0 or more word-characters.


You need a new enough version of clang or gcc to recognize your CPU's microarchitecture and map it to a code-name. An old gcc version will just print something like -march=core2 even for a Haswell, and -mtune=intel or something.

Another similar approach is to filter the asm output from gcc's -fverbose-asm, which includes the optimization options as comments. I don't know a clang equivalent for this.

gcc -xc /dev/null -O3 -fverbose-asm -march=native -o- -S | grep -o 'arch=\w*'

arch=core2

This works on a Haswell system: see this example on the Godbolt Compiler Explorer. Note the -march=haswell in the output.

Solution 5:

There's an iOS and Mac app called Mactracker. It shows various pieces of info about Macs.