Suppose that we are given two independent sets I b and Ir of a graph such that |Ib| = | Ir|, and imagine that a token is placed on each vertex in I b. Then, the sliding token problem is to determine whether there exists a sequence of independent sets which transforms Ib and I r so that each independent set in the sequence results from the previous one by sliding exactly one token along an edge in the graph. This problem is known to be PSPACE-complete even for planar graphs, and also for bounded treewidth graphs. In this paper, we show that the problem is solvable for trees in quadratic time. Our proof is constructive: for a yes-instance, we can find an actual sequence of independent sets between Ib and Ir whose length (i.e., the number of token-slides) is quadratic. We note that there exists an infinite family of instances on paths for which any sequence requires quadratic length.