Algebraic curves have a discrete analog in finite graphs. Pursuing this analogy, we prove a Torelli theorem for graphs. Namely, we show that two graphs have the same Albanese torus if and only if the graphs obtained from them by contracting all separating edges are 2-isomorphic. In particular, the strong Torelli theorem holds for 3-connected graphs. Next, using the correspondence between compact tropical curves and metric graphs, we prove a tropical Torelli theorem giving necessary and sufficient conditions for two tropical curves to have the same principally polarized tropical Jacobian. By contrast, we prove that, in a suitably defined sense, the tropical Torelli map has degree one. Finally, we describe some natural posets associated to a ...