I've drawn an irregular shape in illustrator and I want to know what its area is then I want to compare it between another shape
How could I calculate its area in Illustrator (CS6 or CC)?
There's unfortunately no way of getting the area in Illustrator (CS6/CC) natively that I know of.
You may have more luck with scripts.
I found one here that seems to work.
The code seems rather simple:
alert("Area & Length (inches)\nArea: " + (Math.abs(app.activeDocument.selection.area/5184).toFixed(3)) + "\nLength: " + (app.activeDocument.selection.length/72).toFixed(3));
You could also convert these measurements from inches to centimeters. The source page seems to go into some descriptions on how to customize it.
Getting area in CS-CS5
That being said you can look at it through an unsupported feature in CS5 and below (down to CS I believe) by clicking:
Select your path then open the
object section and look at the area read-out:
I can't tell you how to interpret that area read-out (I'd assume points) but you can use it as a point of comparison. No pun intended.
Do be careful with this feature as it is unsupported and could cause grief.
If Johannes method fails to work for you, Telegraphics have a free Patharea filter which may do the trick: http://www.telegraphics.com.au/sw/product/patharea
Bryan Buchanan made a script available on github to compute the area of a shape in Illustrator in squared cm or squared inches. I used it on Adobe Illustrator CC 2020.
In order to use the script you have to:
.jsx(right click on "raw" and then "save as" somewhere on you computer).
File/Scripts/Other scripts...(or shortcut
.jsxfile in the folder pannel
The shape(s) area will be displayed in a pop-up window.
If you want the script to appear directly in the
File/Script menu, you have to place the ".jsx" file in the subfolder
Presets. The exact path to that folder depends on you operating system, Illustrator version and language, but should look like this on Windows:
C:\Program Files\Adobe\Adobe Illustrator 20xx\Presets\en_GB\Scripts