Herein an approach to controlling the pore size of mesoporous carbon thin films from metal-free polyacrylonitrile-containing block copolymers is described. A high-molecular-weight poly(acrylonitrile-block-methyl methacrylate) (PAN-b-PMMA) is synthesized via reversible addition-fragmentation chain transfer (RAFT) polymerization. The authors systematically investigate the self-assembly behavior of PAN-b-PMMA thin films during thermal and solvent annealing, as well as the pore size of mesoporous carbon thin films after pyrolysis. The as-spin-coated PAN-b-PMMA is microphase-separated into uniformly spaced globular nanostructures, and these globular nanostructures evolve into various morphologies after thermal or solvent annealing. Surprisingly, through thermal annealing and subsequent pyrolysis of PAN-b-PMMA into mesoporous carbon thin films, the pore size and center-to-center spacing increase significantly with thermal annealing temperature, different from most block copolymers. In addition, the choice of solvent in solvent annealing strongly influences the block copolymer nanostructure and the pore size of mesoporous carbon thin films. The discoveries herein provide a simple strategy to control the pore size of mesoporous carbon thin films by tuning thermal or solvent annealing conditions, instead of synthesizing a series of block copolymers of various molecular weights and compositions.