We introduce the notion of orbit equivalence of directed graphs, following Matsumoto’s notion of continuous orbit equivalence for topological Markov shifts. We show that two graphs in which every cycle has an exit are orbit equivalent if and only if there is a diagonal-preserving isomorphism between their (Formula presented.)-algebras. We show that it is necessary to assume that every cycle has an exit for the forward implication, but that the reverse implication holds for arbitrary graphs. As part of our analysis of arbitrary graphs (Formula presented.) we construct a groupoid (Formula presented.) from the graph algebra (Formula presented.) and its diagonal subalgebra (Formula presented.) which generalises Renault’s Weyl groupoid construction applied to (Formula presented.). We show that (Formula presented.) recovers the graph groupoid (Formula presented.) without the assumption that every cycle in (Formula presented.) has an exit, which is required to apply Renault’s results to (Formula presented.). We finish with applications of our results to out-splittings of graphs and to amplified graphs.