Polyimide (PI)-based carbon foams (CFs) with excellent compressive strength, thermal insulation, and electromagnetic interference (EMI) shielding properties were fabricated through microsphere foaming and carbonization processes. The cell size of CFs ranged from 207.8 to 563.9 μm and could be regulated by adjusting the size of polyester ammonium salts (PEASs), and the chemical structure depended on the carbonization temperature. The compressive strength of C 1100 -PIF-1 was 0.74 MPa with a density of 119.9 kg•m −3 . The thermal conductivities of C 800 -PIF-1 at room temperature, 500, and 1000 °C were 0.126, 0.202, and 0.252 W•m −1 K −1 , respectively. Furthermore, CFs exhibited excellent EMI shielding properties, with C 1100 -PIF-2 and C 1100 -PIF-3 reaching 56.4 and 42.1 dB at 8.2−12.4 GHz. The electrical conductivity fell in the range of 5.5−38.5 S•m −1 . The CFs fabricated in this work, which combined exceptional mechanical strength, thermal insulation, and EMI shielding properties, had potential applications in aerospace, high-temperature insulation, and chemical catalysis.