I'd like to identify which CPU this notebook is using, in terms of code names such as "Ivy Bridge" and "Haswell". The little Apple logo in the upper left shows some information, but not this.
10 Answers
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.
- About this Mac (general CPU info)
- System Profiler (general CPU info)
- Terminal (detailed CPU info)
About this Mac
Clicking on the Apple symbol at the top of your screen, select About this Mac
You will get a screen that gives you an overview of your system. Your processor will be listed 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
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
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
-
Thanks you,
$ sysctl -a | grep \.features\: | fmt -w 48command has helped me for CPU flags output. – pacify Jun 10 '19 at 15:47 -
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.
- 502
-
1Also more (slightly outdated) info here. You can probably get the family/model/stepping numbers with
sysctlbut I don't have a Mac to try that on. – Bob May 20 '16 at 10:41
(Update: the clang -march=native part of this answer may not work anymore, if it ever did. You may need to install GCC specifically, e.g. from brew. Note that XCode installs a gcc symlink to clang, so if you don't have real GCC installed, the gcc command on a Mac will get you Clang.
But @inopinatus comments that Clang is actually the best way.)
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 or icelake-client). For AMD: -march=bdver2 = Piledriver = Bulldozer version 2.
clang -v -xc /dev/null -O3 -march=native -o- -E 2>&1 | grep -o 'target-cpu \S*'
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=\S*'
on my Linux Core2 system prints:
arch=native
arch=core2 <----- This one
arch=native
This command compiles /dev/null as C (-xc since the input filename doesn't imply a language). gcc / clang -v prints its internal commands as it runs them, with full command line args. The front-end sorts out the -march=native and invokes the compiler/preprocessor proper with the actual target arch name. Even with -E (preprocessor-only), the -xc option leads gcc to pass the full set of -march=whatever -mmmx -msse2 ... options. Or for clang, -target-cpu skylake with a bunch of -target-feature +avx for features it has, and -target-feature -cldemote for features it doesn't.
grep -o prints only the matching part of lines that match. \w* matches 0 or more word-characters. But a few arch names include - so we use \S* instead.
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. Or just baseline x86-64 and tune=generic.
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=\S*'
arch=core2
This works on a Haswell system: see this example on the Godbolt Compiler Explorer. Note the -march=haswell in the output. (2022 update: -march=skylake-avx512. With older GCC thinking that newer CPU was -march=knl, Xeon Phi Knight's Landing which is a very different microarchitecture, but at one point the only CPU with AVX-512.)
- 502
-
Interesting and rather novel approach! Question: is
gccorclangsomething one would expect to find on a (non-programmer's) Mac? – Bob May 24 '16 at 03:00 -
@Bob: IDK, I don't even own a Mac! I got here from the "hot network questions" sidebar. Many Unix programs are distributed in source form, so some people will have a C compiler on their Mac, even if you don't program at all, or not in C. (Some perl modules come with C to be compiled, for example.) Anyway, this answer was mostly targeted at people that use gcc or clang on their Mac fairly regularly, but aren't Intel hardware experts. It's possible to be a programmer without being a hardware geek. – Peter Cordes May 24 '16 at 03:07
-
I think
clangis only available after you installed xcode. Besdies it is sufficient to useclanginstead ofclang-3.5– Anthony Kong Jun 05 '18 at 23:27 -
1
clang: error: the clang compiler does not support '-march=native'. Using Appleclangversion13.1.6(clang-1316.0.21.2.5). – ijoseph Aug 29 '22 at 06:37 -
@ijoseph : It still works on my x86-64 Linux desktop with clang 14.0.6. (Of course, that's mainline clang, not Apple clang). I still don't have a Mac, so I can't test any other ideas. Any suggestion on how to fix this answer? – Peter Cordes Aug 29 '22 at 12:40
-
1The original question was clearly in terms of microarchitecture, making this answer far and away the best answer. Clang, particularly Apple clang, unsurprisingly makes a much better guess. In fact gcc is documented only to make adequate guesses on Linux. However, as written, the answer misreports some architectures, such as skylake instead of skylake-avx512. Fortunately, the only change we need is the regex to grep: use \S* instead of \w+ – inopinatus Jun 02 '23 at 07:03
-
@inopinatus: Thanks, good catch. Updated to use
\S*, and to comment that clang should still actually work on current Macs? I'm not a Mac user myself, just someone who gets annoyed when people uselessly say their CPU is a "core i7" when we ask on Stack Overflow what CPU they used in their question about some performance effect. – Peter Cordes Jun 02 '23 at 07:43
Go to one of the Mac upgrade sites and enter your serial number/model number from About this Mac.
Example http://www.everymac.com/ultimate-mac-lookup/
Enter serial no.
Enter Catpcha information.
You'll get the summary specs
Click on Complete Mac specs.
And it will tell you the chips details (22nm Haswell i5 4250U) plus also comparisons to the prior and later models.
- 131
There's an iOS and Mac app called Mactracker. It shows various pieces of info about Macs.
- 3,551
-
Not sure why this was downvoted. This is a free app and very helpful. Simply find the model, go to General tab, and it tells you exactly what you want. – Hefewe1zen May 26 '16 at 17:12
In the Apple menu (top left of your screen) select About This Mac. Then look for a button that says More Info, it will open a window with EVERYTHING about the mac including it's model number (MacBook Pro 12.3 for example) then use the MacTracker app mentioned above or just search on that name ant you will get that info.
- 22,915
The best way I found to find out information about your CPU in an Apple computer is to run the MacCPUID utility by Intel. You can find it here.
- 11
Based on solutions provided in this thread and others, I have put together this small script.
#!/bin/bash
List CPU information
https://apple.stackexchange.com/questions/352769/does-macos-have-a-command-to-retrieve-detailed-cpu-information-like-proc-cpuinf/352770
Also : https://apple.stackexchange.com/questions/238777/how-do-i-identify-which-cpu-a-macbook-uses/238789#238789
Interesting output with system_profiler SPHardwareDataType | grep Processor
usage () {
printf "%s \n" "Usage : ./cpu_info.sh [--short | --all | --help]"
printf "\n"
printf "%s \n" "--short : print CPU Brand/Model, Core count, Thread count."
printf "%s \n" "--all : print all cpu information."
printf "%s \n" "--help : print this usage message."
}
if [ -z "$1" ]; then
sysctl -n machdep.cpu.brand_string
sysctl -a | grep machdep.cpu.core_count | sed 's/machdep.//'
sysctl -a | grep machdep.cpu.thread_count | sed 's/machdep.//'
elif [ "$1" = "--all" ]; then
sysctl -a | grep machdep.cpu
elif [ "$1" = "--short" ]; then
sysctl -n machdep.cpu.brand_string
sysctl -a | grep machdep.cpu.core_count | sed 's/machdep.//'
sysctl -a | grep machdep.cpu.thread_count | sed 's/machdep.//'
elif [ "$1" = "--help" ]; then
usage
else
usage
fi
It gives you an output like this:
❯ ./cpu_info.sh
Intel(R) Core(TM) i7-1068NG7 CPU @ 2.30GHz
cpu.core_count: 4
cpu.thread_count: 8
Feel free to copy/paste from here or go to the corresponding GitHub repo to get the latest version available: https://github.com/kral2/osx-scripts/blob/main/system-config/cpu_info.sh
- 13
-
While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. – grg Sep 08 '21 at 20:20
-
If you're here to get the supported instructions of an Apple Silicon Mac's CPU like I was, you're gonna want:
$ sysctl hw
hw.ncpu: 8
hw.byteorder: 1234
hw.memsize: 17179869184
hw.activecpu: 8
hw.perflevel0.physicalcpu: 4
hw.perflevel0.physicalcpu_max: 4
hw.perflevel0.logicalcpu: 4
hw.perflevel0.logicalcpu_max: 4
hw.perflevel0.l1icachesize: 196608
hw.perflevel0.l1dcachesize: 131072
hw.perflevel0.l2cachesize: 12582912
hw.perflevel0.cpusperl2: 4
hw.perflevel1.physicalcpu: 4
hw.perflevel1.physicalcpu_max: 4
hw.perflevel1.logicalcpu: 4
hw.perflevel1.logicalcpu_max: 4
hw.perflevel1.l1icachesize: 131072
hw.perflevel1.l1dcachesize: 65536
hw.perflevel1.l2cachesize: 4194304
hw.perflevel1.cpusperl2: 4
...
- 100,768
- 1,717



ark.intel.comis able to tell me that after looking upi7-3770) – Num Lock May 19 '16 at 07:14