The band alignment and the chemical bonding at the beta -Ga2O3/AlN and beta -Ga2O3/GaN interfaces are studied through hybrid functional calculations. We construct realistic slab models with III-O (III = Al, Ga) bonds dominating the chemical bonding at both interfaces. The epitaxial relationships between beta -Ga2O3 and wurtzite AlN and GaN determined from experiments are adopted in our slab models. These models satisfy electron counting rules, and all the dangling bonds are saturated at the interfaces. beta -Ga2O3 is found to form type II heterojunctions with both wurtzite AlN and GaN. For the interfaces with AlN and GaN substrates, the calculated valence band offsets are 0.74 and 0.90eV, respectively. These are in good agreement with the experimental values. The obtained band alignments are useful for designing optical and electronic devices based on beta -Ga2O3 and group III nitrides.