Let be a finite, simple graph. For a triple of vertices of , a vertex of is a median of , and if lies simultaneously on shortest paths joining and , and , and and respectively. is a median graph if is connected, and every triple of vertices of admits a unique median. There are several characterizations of median graphs in the literature; one given by Mulder is as follows: is a median graph if and only if can be obtained from a one-vertex graph by a sequence of convex expansions. We present an algorithm for recognizing median graphs, which is based on Mulder’s convex-expansions technique. Further, we present an algorithm for obtaining an isometric embedding of a median graph in a hypercube with as small as possible.