We studied the dependence of carbon (C) incorporation on the crystallographic orientation during metalorganic vapor phase epitaxy (MOVPE) of GaAs and AlGaAs. We performed C doping to GaAs grown with trimethylgallium (TMGa) and AsH3 and Al0.35Ga0.65As grown with trimethylaluminum (TMAl), TMGa or triethylgallium (TEGa), and AsH3 on the surface lying between (100) and (111) A/B. C and hole concentrations nearly coincided over the entire orientation range, showing that C is preferentially incorporated at As sites, irrespective of orientation. We found that the dependence of C incorporation on the orientation is more complex than previously thought. The dependence of carrier concentration on the AsH, partial pressure reflected the degree of C incorporation very well. Using simultaneous doping with C accepters and Si donors, we fabricated lateral p-n junctions on patterned substrates composed of the (100) principal surface and (411)A/B sidewalls.