The Torelli theorem establishes that the Jacobian of a smooth projective curve, together with the polarization provided by the theta divisor, fully characterizes the curve. In the case of nodal curves, there exists a concept known as fine compactified Jacobian. The fine compactified Jacobian of a curve comes with a natural stratification that can be regarded as a poset. Furthermore, this poset is entirely determined by the dual graph of the curve and is referred to as the poset of quasistable divisors on the graph. We present a combinatorial version of the Torelli theorem, which demonstrates that the poset of quasistable divisors of a graph completely determines the biconnected components of the graph (up to contracting separating edges). Moreover, we achieve a natural extension of this theorem to tropical curves.