Replicating bacterial chromosomes continuously demix from each other and segregate within a compact volume called nucleoid inside the cell. While many proteins involved in this process have been identified, the nature of the forces that shape and segregate the chromosomes has remained unclear because of our lack of knowledge in micromechanical properties of the chromosome. In this work, we experimentally reveal the soft nature of the bacterial chromosome that makes it susceptible to the entropic forces in a crowded intracellular environment. We developed a unique optical-trap "micropiston" to measure the force-compression curves of individual Escherichia coli chromosomes in confined space. Our data show that ~ 100 pN forces are sufficient to compress the chromosome to the size of the cell and ~10^5 kT free energy is stored in the in vivo nucleoid, which is thousand-fold smaller than the surrounding turgor pressure inside the cell. Further, confining microchannels were used to investigate the dynamic response of individual chromosomes following cell lysis, giving a fast, characteristic timescale of global motion (~ 10s), as well as morphological dynamics and dissociation kinetics of histone-like protein HU from the whole chromosome. In particular, using depletion (entropic) forces by molecular crowding, we were able to monitor in realtime repeatable and reversible compaction-decompaction cycles of the chromosome in confinement, during which the chromosomes abruptly collapse to their in vivo size. These results provide quantitative, experimental support for a physical model in which the bacterial chromosome behaves as a loaded entropic spring in vivo.