You could also (in theory) put every human on Earth in Texas with a population density of only 26,000 people per square mile, about the same density as New York City.
If it's an equilateral square pyramid, the volume would be about a quarter of a cubic kilometer. If we assume humans have an average mass of 65 kg and the same density as water, that gives us room for just under 4 billion humans.