There’s a myth going around that to do a double major, you have to do 225 units to graduate.
This is not true. You can do a double major, even in wildly different fields, and the total number of units required to graduate remains 180 units.
Now, there is a seed of truth to this myth—there are two potential paths to a double major, and one path requires 180 units and the other path requires 225 units. The 180-unit route is much more common, but the 225-unit route is a possibility if the two majors you are pursuing lead to different degrees - BS and BA. This is called a Dual Degree. However, regardless of the composition of your double major, you are not required to pursue the Dual Degree option .
ExploreDegrees is the authoritative source on these regulations, and you should read the official explanation of the types of Bachelor’s Degrees that Stanford offers to understand your options.